Vicigo logo

Tutorial: Publishing Ionic Android App

2016-03-05 Vicigo

Ensure that the android platform has been added:

ionic platform add android

Remove the debug console plugin:

cordova plugin rm org.apache.cordova.console   #Old Name
cordova plugin rm cordova-plugin-console       #New Name

Create the signing key (This need to be done only once) You need to create a signing key for your app. Note: Make sure you keep the keystore file safe as you will need it to release updates.

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

Create the release This will create the release. Remember to set up the version number in the config.xml.

ionic build --release android

Go to the directory:

cd ./platforms/android/build/outputs/apk

Sign the unsigned APK To sign the file you will need to use the jarsigner tool.

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore myapp-release-key.keystore android-release-unsigned.apk app

Note: The alias used here must be the same as you used for generating the key with keytool few steps before. Otherwise you will receive the following error message:

jarsigner: Certificate chain not found for: myapp.  myapp must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.

Zip align the resulting APK The zipalign tool is in the android-sdk/build-tools/{version}/ folder. To use it straight away, just update your PATH export PATH=$ANDROID_HOME/build-tools/AndroidSDKVersion:$PATH

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

Images from viciceo

Vicigo - explore the world of hashtags