1、创建签名,设置密码,把创建的签名文件存放到项目文件中
keytool -genkey -v -keystore xxx.keystore -alias XXXKEY -keyalg RSA -keysize 2048 -validity 10000
2、命令行进入到项目目录中
cd 生成路径
3、打包
cordova build android --release
4、签名
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore xxx.keystore platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk XXXKEY
5、优化
/Users/XXX/Library/Android/sdk/build-tools/29.0.3/zipalign -v 4 /Users/XXX/Stash/MyApp/platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk xxx.apk
网友评论