Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

like image 487
IrishGringo Avatar asked Apr 06 '18 19:04

IrishGringo


2 Answers

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

like image 90
IrishGringo Avatar answered Oct 27 '22 06:10

IrishGringo


for release key this one solved my problem

keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test
like image 24
Rajesh Jr. Avatar answered Oct 27 '22 05:10

Rajesh Jr.