Updating an app on Play store is something which is a routine task if you wish to optimize the app and increase usability for the users. When we try to publish an update for an existing app to play store we SHOULD use the existing key store file which we used while initially publishing the app on play store.
While trying to achieve this, I have faced a few issues, and have found ways to do the same via Command/terminal.
You can use the same, below are the steps to do them.
I am taking an example where you have an HTML android application which you want to build, sign and zipalign in order to publish it to play store.
Build the apk using cordova command line
- Open command prompt and go to the app folder path
- Run the following command to generate release build
- Cordova build android –release
Sign the app with existing keystore
- Open command prompt and go to jarsigner path
- Jarsigner will be usually found in jdk\bin folder
- Run the following command
- <JDK path>\bin>jarsigner -verbose -keystore <keystore file path> <apk path with apk file name> <key store alias>
- You will be prompted to enter the password of the key store file. Enter it
- The apk will be signed but no new apk will be generated instead it’ll be overwritten
Zipalign the apk file
- Open the command prompt and go to zip align path which can be found in android-sdks\build-tools\<version>
- Run the following command
1. <android SDK path>\android-sdks\build-tools\23.0.3 - A new apk file will be generated in the specified path
The output apk file of the last step can be published to play store.