Conner Gesbocker
Conner Gesbocker

Reputation: 394

Can't retrieve SHA-1 key from Windows CMD line

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

This is the instructions from Google "Firebase in a weekend". However this is not working. I have tried to add my JRE to the path variable and have done ample research but I keep getting this error...

C:\>-alias androiddebugkey -keystore %CONNERGESBOCKER%\.android\debug.keystore
'-alias' is not recognized as an internal or external command,
operable program or batch file.

thanks!

Upvotes: 1

Views: 500

Answers (3)

Aqsa Shahid
Aqsa Shahid

Reputation: 64

If you are using android studio use simple step

  1. Run your project
  2. Click on Gradle menu
  3. Expand Gradle task tree
  4. Click on android-> signingReport and see the magic
  5. It will tell you everything

Upvotes: 0

Adithya
Adithya

Reputation: 1728

I found a easy way to get SHA-1

go to Gradle menu on right side of screen then Task->android->SigningReport . double click it. after its complete you will see SHA-1 in the "Run" menu at botton(Scroll up to see it).

Upvotes: 0

Ken Wolf
Ken Wolf

Reputation: 23269

It's splitting it into two lines incorrectly.

Change the command to be a single line:

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

Upvotes: 4

Related Questions