To create a Keystore file, you will need to hop in terminal and run a few commands.
cd /path/to/keystore/folder
keytool -genkey -v -keystore projectname.keystore -alias ProjectName -keyalg RSA -keysize 2048 -validity 10000
Enter keystore password: **********
Re-enter new password: **********
What is your first and last name?
[Unknown]: Peter Schmalfeldt
What is the name of your organizational unit?
[Unknown]: Mobile Development
What is the name of your organization?
[Unknown]: Manifest Interactive, LLC.
What is the name of your City or Locality?
[Unknown]: St. Petersburg
What is the name of your State or Province?
[Unknown]: Florida
What is the two-letter country code for this unit?
[Unknown]: US
Is CN=Peter Schmalfeldt, OU="Mobile Development", O="Manifest Interactive, LLC.", L=St. Petersburg, ST=Florida, C=US correct?
[no]: yes
Enter key password for <PanicPress>
(RETURN if same as keystore password): PRESS RETURN
To add your newly created Keystore to your Android Project, do the following:
cd /path/to/android/project
nano ant.properties
Add the following to ant.properties
:
key.store=/path/to/keystore/folder/projectname.keystore
key.store.password=**********
key.alias=ProjectName
key.alias.password=**********
Make sure you are updating the path and project names correctly. keystore-name
as used below denotes the alias
you used when creating your projectname.keystore
file.
cd /path/to/cordova/project
cordova build android --release
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore /path/to/keystore/folder/projectname.keystore platforms/android/build/outputs/apk/android-release-unsigned.apk keystore-name
/path/to/andoid/sdk/build-tools/22.0.1/zipalign -v 4 platforms/android/build/outputs/apk/android-release-unsigned.apk platforms/android/build/outputs/apk/project-v1.0.0.apk
open platforms/android/build/outputs/apk/