Building & Submitting App to Google Play

Pre-reqs

  • Increment config.xml version with every build
  • Make sure the android platform has been added cordova platform add android
  • Remove the debug console cordova plugin rm cordova-plugin-console
  • Generate a release build ionic build --release android

Add/Create Keystore

This command will create a keystore with the given name if the file doesn't exist or append a key to a current keystore.

keytool -genkey -v -keystore myapp-release-key.keystore -alias myapp -keyalg RSA -keysize 2048 -validity 10000

List aliases within a keystore with this command:

keytool -list -keystore mykeystore.keystore

Sign Build with Key

Find the build here:

./platforms/android/build/outputs/apk/android-debug-unaligned.apk

Sign it using this:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore mykeystore.keystore android-release-unsigned.apk [alias name]

Compress & Optimize

zipalign -v 4 android-release-unsigned.apk android.apk

# OR

~/Library/Android/sdk/build-tools/23.0.2/zipalign -v 4 android-release-unsigned.apk myapp.apk

That's it!

You're ready to submit to Google Play

Creds