- Open CMD as administartor
- Go to your JDK's
bin
folder:
C:\Program Files\Java\jdk1.8.0_121\bin
- Run:
keytool -genkey -v -keystore C:\myKeystoreName.keystore -alias myName -keyalg RSA -keysize 2048 -validity 10000
- Add a
build.json
file to your Cordova folder (where theplatforms
andwww
folders reside). It should look like this:
{
"android": {
"release": {
"keystore": "C:\\myKeystoreName.keystore",
"storePassword": "password_youve_set",
"alias": "myName",
"password" : "alias_password_youve_set",
"keystoreType": ""
}
}
}
- Open CMD
- Go to your Cordova folder (where
build.json
is located) - Run:
cordova build android --release --buildConfig build.json
- Go to:
yourCordovaFolder\platforms\android\build\outputs\apk
- There should be a file, named
android-release.apk
. That's your file.
The .keystore
file is a container of certificates, private keys, etc. In this case, it stores a self-signed certificate, which is:
an identity certificate that is signed by the same entity whose identity it certifies
You'll use it in all your future builds of the app, so save it somewhere safe.