Resource: http://www.intown.biz/2014/07/15/signing-your-cordova-android-app/
To create the signed apk via CLI, open the Terminal app.
Make sure your starting position is within your project’s root folder of /helloCordova and run:
keytool -genkey -v -keystore hellocordova.keystore -alias hellocordova -keyalg RSA -keysize 2048 -validity 10000
Answer the questions at each prompt. For 2-letter country code, look up this list: http://www.worldatlas.com/aatlas/ctycodes.htm
If any of the information is wrong, type the two letters to re-enter that information. For instance, cn to change your first and last name. Confirm the information by typing "yes".
Return if the password for the following information will be the same as the previous info (hit enter).
Your keystore file is saved at /helloCordova/hellocordova.keystore. Get the full path for use later: /Users//helloCordova/hellocordova.keystore (I grabbed my path by dragging the hellocordova.keystore file from the Finder window into the Terminal app.)
Open helloCordova/hellocordova.properties in a text editor.
Add two lines at the end (the file will be saved automatically):
key.store=hellocordova.keystore key.alias=hellocordova
Open helloCordova/platforms/local.properties in a text editor.
Add two lines to this file, even though it says, "This file is automatically generated. Do not modify this file - YOUR CHANGES WILL BE ERASED!"
key.store=/hellocordova.keystore key.alias=hellocordova
When run, the script will pause and you'll be prompted for the password twice and it will not be obfuscated.
- In Terminal, run:
cordova build android --release
- Your hellocordova-release.apk file, signed and zip-aligned, is put in /helloCordova/platforms/android/ant-build (check your Projects view window). This is the file you upload to Google Play.