user3293156 user3293156 - 1 year ago 185
Android Question

Generate non-debug apk from ionic

I am using ionic framework to generate apk for android platform.

After running

ionic build android
, an android-debug.apk is generated. How can I generate a non-debug apk which is smaller and faster?

Answer Source

This is my android release shell script




ionic build --release android

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore "path/to/your/keystore" "platforms/android/build/outputs/apk/android-release-unsigned.apk" "keystore alias" -storepass xxx -keypass xxx 

/path/to/android-sdk/build-tools/23.0.2/zipalign -v 4 "platforms/android/build/outputs/apk/android-release-unsigned.apk" "android-release.apk"

rm "platforms/android/build/outputs/apk/android-release-unsigned.apk"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download