Build the APK
First of all we need to build the APK.
ionic build --release android
Generate private Key
Then we will create a keystore to sign the APK.
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Sign the APK
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore HelloWorld-release-unsigned.apk alias_name
ionic-project/platforms/android/build/outputs/apk
.Zip the APK
zipalign -v 4 HelloWorld-release-unsigned.apk HelloWorld.apk
/Users/username/Library/Android/sdk/build-tools/XXX/
ionic-project/platforms/android/build/outputs/apk
.