mhafizhasan
9/25/2017 - 7:27 AM

Ionic Signing Android APK

Ionic Signing Android APK

Pre Compile

config.xml

  • name : app name
  • widget id : our unique reverse app domain
  • widget version : increment app version before each publish

Generate Icon & Splash Screen

  • icon size : 1024px X 1024px
  • splash screen size : 2732px X 2732px
  • file type : .png

to generate resources : ionic cordova resources

Compile

  1. build and minify
ionic cordova build android --prod --release
  1. generate keystore file
keytool -genkey -v -keystore my-release-key.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias
  1. verify signed APK
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.jks android-release-unsigned.apk my-alias
  1. sign using zipalign tools which can be found at ~/Library/Android/sdk/build-tools/VERSION/zipalign
zipalign -v 4 android-release-unsigned.apk HelloWorld.apk

allow navigation in config.xml

<allow-navigation href="*" />