When your game is ready to be released, it needs to be compiled into release version, the command needs to add-m release, the compiler command is as follows:
Cocos compile-p android-m Release
At the end of the compilation, the xxx_release_unsigned.apk is generated, and the signature is prompted to enter the path of the. KeyStore.
how to generate the. KeyStore :
With Keytool, the command is as follows:
Keytool-genkey-v-keystore My-release-key.keystore-alias alias_name-keyalg rsa-keysize2048-validity10000
Keytool Options |
Description |
-genkey |
Generate a key pair (public and private) |
-V |
Allow verbose content output. |
-alias |
The alias of the key. Only the first 8 characters are used. |
-keyalg |
The encryption algorithm when the key is generated. Supports DSA and RSA. |
-keysize |
The size of the generated key (bits). If not provided, Keytool uses the default key size: 1024. In general, we recommend using a key size of 2048 or greater. |
-dname |
The identity name that describes the creator of the key. In the self-signed certificate, this parameter appears in the Publisher and Subject field. Note that you do not specify this option under the command line. At this point Jarsigner will prompt you to enter each identity name field (CN, OU, etc.) |
-keypass |
Key's password. For security reasons, do not include this option on the command line. Keytool will prompt you to enter your password. In this way, the password is not saved in the shell history data. |
-validity |
The validity period of the key, in days. Note: It is recommended to use a number of 10000 or greater. |
-keystore. KeyStore |
Save the KeyStore name of the private key. |
-storepass |
KeyStore's password. For security reasons, do not include this option on the command line. At this point, Keytool will prompt to enter this password. In this way, the password is not saved in the shell history data.
|
After generating the KeyStore, follow the prompts and note that the Alias_name entered here is consistent with the. KeyStore.
Release version of COCOS2DX 3.0 on the Android platform signing process