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

keytool

Book-Pro:main vy$ keytool -exportcert -list -v \
> -alias androiddebugkey -keystore ~/.android/debug.keystore
keytool error: java.lang.Exception: Only one command is allowed: both 
-exportcert and -list were specified.

I am trying to create a SHA1 on MBP for an android Firebase project.
I pull the command from the Firebase console as described…
https://developers.google.com/android/guides/client-auth

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

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

I have tried hand typing this thinking that perhaps there is a problem with the browser. I installed new JDK… not sure what is going wrong here. assistance please

Best Answer

I sort of fixed it... but Id still like comments.

For Linux / UNIX:

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

For Windows:

keytool -list -v -alias androiddebugkey -keystore %USERPROFILE%/.android/debug.keystore

observe I removed the -exportcert part and I did get a sha1 back

Related Topic