If you have
Finished your
Phonegap application and you want to submit it to Google Play Store then you should follow the following steps:
1. Register in Google Developer Console (
https://play.google.com/apps/publish/signup/ ) - $ 25.00
- After you pay for membership, you will need to wait max 48h to Google finish the transaction, but until then you will be able to create new application, upload you .apk file etc..
2. You must upload the zipaligned .apk file to Play Store.
3. How to zipalign your .apk file with phonegap / cordova?
- First you must create the myApp .keystore file.
- Copy myapp.keystore to /platforms/android. Now it’s time to sign the app with the key and create the release version.
- Open myApp/platforms/android/local.properties (or project.properties) in a text editor.
- Add these two lines at the end and save, even though it says, “Do not modify this file — YOUR CHANGES WILL BE ERASED!”
key.store=myapp.keystore
4. Still in your /myApp folder in Terminal, run:
cordova build android --release You’ll be asked for your password twice and it won’t be obfuscated.
5. Your myApp.apk file is put in /myApp/platforms/android/ant-build/CordovaApp-release.apk. This is the file you rename and upload to Google Play.
How to generate .keystore file?
The signing key is a small file which identifies the creator. It will get built into the .apk file so the developer who built the app can be identified. Since the information in the signing key is all supplied by the developer, it really doesn't provide any security. It will make sure that updates to an app are generated by the same user.
1. Install the Java Development Kit
2. Open a CMD or Terminal session
On Windows, open a cmd window and change directory to
cd c:\Program Files\Java\jdk1.7.0_25\bin
3. Use KeyTool to create the keystore file
Enter this command, replacing 'KitchenSink' with the name of your app.
keytool -genkey -v -keystore myApp.keystore -alias myApp -keyalg RSA -keysize 2048 -validity 10000
The file KitchenSink.keystore has now been created in c:\Program Files\Java\jdk1.7.0_25\bin. If you would like it created elsewhere, replace KitchenSink.keystore with the complete path. i.e.
Here are a few more good blogs which could help you: