Keytool is in the/bin directory of JDK, such as/opt/JDK/bin.
Use the following command to generate a certificate:
Keytool-genkey-alias Android. Key-keyalg RSA-validity 20000-keystore Android. Key
The following error is always reported:
It was later known that the current directory does not have the write permission, so you need to specify a path to store Android. Key:
Keytool-genkey-alias Android. Key-keyalg RSA-validity 20000-keystore/<my_path>/Android. Key
Note: What is the two-letter country code for this unit (CN in China)
If the following error occurs during packaging: jarsigner: The certificate chain of Android. Key cannot be found. Android. Key must reference a valid keystore key entry that contains a private key and the corresponding public key certificate chain.
It may be that the-alias part has a different path name than the subsequent keystore.
View Certificate Information:
Keytool-list-v-keystore Android. Key-storepass <psw>