Question Detail

java.lang.Exception: Only one command is allowed: both -exportcert and -list were specified. Mac

5 years ago Views 2800 Visit Post Reply

I am tring to get my SHA 1 debug key in Mac OS, but i am getting error while exicuting 

To get the debug certificate fingerprint:

MAC/LINUX

keytool -exportcert -list -v \ -alias androiddebugkey -keystore ~/.android/debug.keystore

Then it Gives me error mentioned below 

keytool error: java.lang.Exception: Only one command is allowed: both -exportcert and -list were specified.


Thread Reply

Anonymous

- 5 years ago

You are tring to access incorrectly formatted certificate is being imported into the keystore. This issue is caused by the fact that the The JDK keystore accepts only a specific format of a certificate.

You can use another way to Genrate SHA1 KEY in Mac 
 

SHA 1 fingerprint of keystore certificate

Mac / linux OS Debug Fingerprint

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

for Release mode:

keytool -list -v -keystore {keystore_name} -alias {alias_name}