Publish a Phonegap App to Play Store

publish-a-phonegap-app-playstore-cordova-ionic

publish-a-phonegap-app-playstore-cordova-ionic

Publish a Phonegap App to Play Store

This article, I’m going to write about how to publish a PhoneGap app to play store (Google / Android). you can use the same steps for publishing your Ionic & Cordova applications to Play Store

This Includes following steps

  1. Generate apk in release mode
  2. Generate Key store file
  3. Signing your app
  4. Zip align your apk

Step 1: Remove Console Plugin

cordova plugin remove cordova-plugin-console

Step 2: Generate APK in release mode

cordova build --release android
  • This will generate release apk in platforms/android/build/outputs/apk/android-relase-unsigned.apk
  • Rename your apk with yourappname.apk & move the file into root folder

Step 3: Generate Key store file

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

Changes

  • my-release-key.keystore to yourappname.keystore
  • alias_name to yourappname

Step 4: Signing your application using jarsigner

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore HelloWorld-release-unsigned.apk alias_name

Changes

  • my-release-key.keystore to yourappname.keystore
  • HelloWorld-release-unsigned.apk to yourappname.apk
  • alias_name to yourappname

Step 5: Zip align your apk

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

Changes

  • HelloWorld-release-unsigned.apk to yourappname.apk
  • HelloWorld.apk to yourappname-final.apk

Congrats !!! Now you can upload yourappname-final.apk to playstore

Learn More https://developer.android.com/studio/publish/app-signing.html

  • Sandeep Marwal

    I am using cordova 6.x and working with command line.
    I have follow your steps but got stuck at step 3 and getting the error.

    attached error image.

  • Sandeep Marwal

    I fixed the issue

    Thank You so much bro

  • Guilherme

    Could you help fix this error? Error: Error code 1 for command: cmd with args: /s, /c, “C:….platformsandroidgradlew cdvBuildRelease -b c:..platformsandroidbuild.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true”

    • You need to install gradle. please google it “How to install gradle”

  • Guilherme

    Hi, I’m new on phonegap development. Where do I need to put this commands? Is this in windows prompt?