Build a release version using Cordova
--release android
Or
ionic build android -release
See Build successful Description widget success
APK is generated under this path
Name of your project \platforms\android\build\outputs\apk
Create key
1. Need to use Keytool.exe
(located under the Jdk1.x.x\jre\bin directory), which is added to the environment variable path
2. Use the generated key to sign the APK with Jarsigner.exe
(located under the Jdk1.x.x\bin directory), which is added to the environment variable path
3. Open cmd
4. Generate key
D:\>keytool -genkey -alias demo.keystore -keyalg RSA -validity 40000 -keystore demo.keystore/*说明:-genkey 产生密钥 -alias demo.keystore 别名 demo.keystore -keyalg RSA 使用RSA算法对签名加密 -validity 40000 有效期限4000天 -keystore demo.keystore */
Signature APK
D:\>jarsigner -verbose -keystore demo.keystore -signedjar demo_signed.apk demo.apk demo.keystore/*说明:-verbose 输出签名的详细信息 -keystore demo.keystore 密钥库位置 -signedjar demor_signed.apk demo.apk demo.keystore 正式签名,三个参数中依次为 签名后产生的文件demo_signed, 要签名的文件demo.apk, 密钥库demo.keystore.*/
Note: The demo.apk in the bin directory of the Android project is signed by default with the debug user, so you cannot use the above procedure to sign the file again. The correct step should be: In the project right click->anroid tools-export Unsigned Application package exported APK takes the above steps to sign.
Ionic Android version release and signature