Generate non-debug apk from ionic

user781486 picture user781486 · Dec 6, 2015 · Viewed 13.3k times · Source

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

Peace Pan picture Peace Pan · Dec 6, 2015

This is my android release shell script

IFY

clear

gulp

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"