Replace the default debug. keystore File With debug. keystore.
Recently, in the development process, it was very troublesome to frequently sign the apk for testing colleagues. Therefore, I wanted to use the default debug for Intellij idea or Eclipse. replace the keystore file with the signature file used for distribution (production environment), so that it can run directly without frequently signing the apk file.
If you directly use the production keystore for debugging, an error will be reported during compilation:
Android Packager: [trunk] java. io. IOException: Keystore was tampered with, or password was incorrect.
When debugging with a custom keystore, you must keep the password, alias, and alias of the custom keystore consistent with the default debug. keystore. Therefore, you must modify the information about the production keystore.
ProcedureThe following uses the production keystore name android. keystore as an example:
① Modify the alias of android. keystore
Keytool-changealias-keystore android. keystore-alias android-destalias androiddebugkey
② Modify the alias password of android. keystore
Keytool-keypasswd-keystore android. keystore-alias androiddebugkey
③ Modify the password of android. keystore
Keytool-storepasswd-keystore android. keystore
④ Copy the modified android. keystore to the. android directory under % userprofile %, change it to debug. keystore, and run the code again.
Note:
① The default debug. keystore password is "android", that is, the password of the signature file should be changed to "android ".
② Keytool is a tool provided by jdk, path: % JAVA_HOME % \ bin