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?
In Android Studio menu Main Menu -> Build Bundle(s) / APK(s) -> Build APK(s) . This then pops up a link with which you can open the file location.
Next, we can find our unsigned APK file in platforms/android/build/outputs/apk . In our example, the file was platforms/android/build/outputs/apk/HelloWorld-release-unsigned.
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"
In cordova 6.2.0 you can release an apk with follwoing commands. Since ionic is a wrapper around cordova, this should work.
cd cordova/ #change to root cordova or ionic folder
platforms/android/cordova/clean #clean if you want
cordova build android --release -- --keystore="/path/to/keystore" --storePassword=password --alias=alias_name #password will be prompted if you have any
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With