How to Publish Ionic App on Google Play Store


After building an android app with the Ionic framework, you will want to publish it on Google Play Store in other to reach more users. Here is a step by step process to build, sign and publish your new Android app.

Requirement

  • Android SDK installed
  • Install ionic CLI
  • Set environmental Variable for Android SDK
1. Install ionic CLI with the following command and cordova
sudo npm install -g ionic
sudo npm install -g cordova

2. Next, we need to create a project. The following code will create a new ionic project.
ionic start myapp blank --type ionic
3. Next, we will run our application with the following command.
cd myapp

ionic serve
4. Next edit [config.xml] file if you want to change package and other configurations.
1. Edit config.xml
If you need to set your package name, app name and how your app should behave, you should edit the file [config.xml].
5. We will add the android platform to our project with the following command.
ionic cordova platform add android

6. Generate a release version of your app
the following command will generate a release android version of your app.
ionic cordova build android --prod --release
It will take a couple of minutes and your debug version should be seen in
 \platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk
7. We need to sign the unsigned APK and run an alignment utility to optimize our newly created app.
We will the Java Development Tool (JDK) to generate a private key for our new app.

keytool -genkey -v -keystore my-key.keystore -alias swagasfoft -keyalg RSA -keysize 2048 -validity 500000
Enter and confirm your password. The above command will generate a key [my-key.keystore]  with alias name [swagasoft], valid for 500000 days. the key file name is [my-key.keystore].
Make sure you save the above file in a safe place. The file will be required to sign yours on each update.
8. To sign the app we will use the [JDK jarsigner] tool.
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-key.keystore app-release-unsigned.apk swagasoft
note my alias name [swagasoft][key-name] and [app-name] should be changed to yours. You will be required to confirm your key password. If everything is correct you will get a success message.
9. Next, we need to sign the app in place for optimization using [zipalign] tool. Te zipalign too can be found in SDK build tool version folder. mine is below
C:\Android\android-sdk\build-tools

copy your app to the above folder. Then run the below command to optimize your app.
./zipalign -v 4 app-release-unsigned.apk new_update.apk
.The above command will generate [new_update.apk] file ready to be published on google play store.
If you had issues,  go to the about page, use any of my contact methods and ill be open to help.
here is a link to my android app build with an ionic framework. SHARES...

Post a comment

0 Comments