Generate Android signing certificate .keystore file under mac
The first step: first check whether the current mac has a JAVA environment installed. If not, go to the JAVA official website to install one. The second step: enter the command in the terminal /usr/libexec/java_home -V
to check our jdk address, and then cd to switch to that location.
cd /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
## Step 4: Enter the command directlysudo keytool -genkey -alias tagoldalias -keyalg RSA -keysize 2048 -validity 36500 -keystore tagold.keystore
- 36500 is the validity period of the certificate, indicating 100 years of validity, in days. It is recommended to set the time longer to avoid certificate expiration.
- RSA certificate signing algorithm
- keysize 1024 key size
- tagold202309.keystore key name
- alias is the certificate alias, which can be modified to the characters you want to set. It is recommended to use English letters and numbers.
Step 5: After the keystore is generated, use the warning command to migrate the keystore's format jks to pkcs12
sudo keytool -importkeystore -srckeystore tagold.keystore -destkeystore tagold.keystore -deststoretype pkcs12
Enter the keystore password:
Note:
1) When generating the keystore, the Key store password and the Key alias password must be set the same;
2) After the keystore is generated, use the warning command to migrate the keystore format from jks to pkcs12; it will be backed up after the migration is successful. Old files, ending with .old, are basically no longer used and can be deleted directly;
Step Six: Certificate Location
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
The path address here is the path address of the java mentioned above. Copy the path and press Enter to enter