1

I'm currently trying the new feature of firebase, and it asks me to provide 'Debug signing certificate SHA-1', I've read the document of how to get the code but I don't know where to find "keytool". By the way, what is the function of this code, will it make differences if I don't provide one in firebase?

Runkun Miao
  • 125
  • 1
  • 1
  • 10

4 Answers4

11

In windows:

  • Navigate to you JRE folder in Windows File Explorer - to the directory with the keytool.exe in the JDK -> bin folder. Mine is in C:\Program Files\Java\jre1.8.0_91\bin but try browsing to the Java folder and see what version you have and change the path accordingly.
  • Right click on the mouse while pressing shift key on your keyboard.
  • Click on Open command window here.
  • To get the debug certificate fingerprint enter in the command window this:

    keytool -exportcert -list -v -alias androiddebugkey -keystore  %USERPROFILE%\.android\debug.keystore
    
  • The keytool utility prompts you to enter a password for the keystore. The default password for the debug keystore is android (or no password, just hit enter). The keytool then prints the fingerprint to the terminal. For example:

    Certificate fingerprint: SHA1: DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09
    
1

From this thread

keytool comes with the Java SDK. You should find it in the directory that contains javac, etc.

Community
  • 1
  • 1
Abdallah Alaraby
  • 2,117
  • 2
  • 16
  • 28
1

Another place is inside of Android Studio, incase you have already have install it:

C:\Program Files\Android\Android Studio\jre\bin\keytool.exe
Rodas PT
  • 51
  • 3
0

(For Windows)

ERRORS I was getting:

  • keytool : The term 'keytool' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
  • keytool error: java.lang.Exception: Keystore file does not exist: %USERPROFILE%\.android\debug.keystore java.lang.Exception: Keystore file does not exist: %USERPROFILE%\.android\debug.keystore

SOLUTION:

Repeat the first steps that @amitai-fensterheim answers to the current question. Steps:

  1. Navigate to you JRE folder in Windows File Explorer - to the directory with the keytool.exe in the JDK -> bin folder. Mine is in C:\ProgramFiles\Java\jre1.8.0_91\bin but try browsing to the Java folder and see what version you have and change the path accordingly.
  2. Right click on the mouse while pressing shift key on your keyboard.
  3. Click on Open command window here.

Then write this on your terminal:

.\keytool.exe -list -v -alias androiddebugkey -keystore $env:USERPROFILE\.android\debug.keystore

Finally, press ENTER to get the SHA1 certificate.

Guillem
  • 526
  • 5
  • 6