How to Build Ionic Cordova Production App Ready for Publish onGoogle 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.

  • 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

Next install the cordova globally.

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

Navigate to project folder after your project has been created successfully

cd myapp

Enter the following command to run your project

ionic serve

4. Next edit [config.xml] file if you want to change package name and other configurations.

HomeframeworkHow to Publish Ionic App on Google Play Store

How to Publish Ionic App on Google Play Store

by –simon jerryon – 07:58

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


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

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 the 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.

swagasoft

Fully stack(MEAN) software engineer with over five years of experience participating in the complete product development lifecycle of successfully launched applications. Eager and willing to deliver mission- critical technology solutions.

View all posts by swagasoft →

Leave a Reply

Your email address will not be published. Required fields are marked *