Releasing Ionic app on Android


Where are there accurate, recent instructions for publishing my Ionic 2 app on the Google Play store. I don’t see anything in the docs or immediately catering to this on the forums, but I probably missed it.


cordova plugin rm cordova-plugin-console

cordova build --release android

keytool -genkey -v -keystore my-keystore-file.keystore -alias EMAIL/PACKAGE_NAME/UNIQUE_ID -keyalg RSA -keysize 2048 -validity 10000

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore PATH_TO/my-keystore-file.keystore platforms/android/build/outputs/apk/android-release-unsigned.apk EMAIL/PACKAGE_NAME/UNIQUE_ID

~/Library/Android/sdk/build-tools/23.0.0/zipalign -v 4 platforms/android/build/outputs/apk/android-release-unsigned.apk signed_releases/APP_NAME_$(date +%F).apk

You only need to generate your keystore the first time (third command), keep that file on a safe place!
Customize the paths I use to your own ones and you should be able to generate your signed apk.


you can also use this one-liner if you already have a key in your keystore.jks:
ionic build android --release -- --keystore="../android.keystore" --storePassword=android --alias=mykey --password=myKeyPassword

see cordova help build and/or cordova docs for detailed information

Steps for preparing Ionic 2 app for Play Store

this is the best guide

Be really carefull with your keystore, if you lose it, you won’t be able to update the app


It looks like Ionic1 and not Ionic2


There is no difference for this task.


thanks very much that very help for me


this one liner worked for me in the past but i came after two months (now may 2017) back to my project and its generating only unsigned apk any known reason?


Sorry man, no idea. I moved all my builds (android and iOS) to the ionic cloud.
Android works for development and production, iOS only development …


really interesting so maybe i should also consider ionic cloud…
interesting so you helped me


For development builds I use:

- ./sh/
- npm run build
- ./sh/ android
- ./sh/ ios

IONIC_PACKAGE_BUILD_PROFILE is the name of your profile in the ionic cloud.

and I adapted like this:

  if [ -z "$1" ]; then
    fail "ionic-package: specify either 'ios' or 'android' as parameter of the script"

  # Command arguments

HTH :slight_smile:


A post was split to a new topic: Keystore file does not exist