5

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
  • 335
  • 1
  • 3
  • 14

5 Answers5

17

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
    
9

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
  • 309
  • 3
  • 5
  • If you are creating a signing key then you need to use this Android version of keytool. The Android sdk requires a key where the keystore and the key have passwords. The java version only creates keystores with a password on the store not the key. – darrenp Jun 15 '22 at 22:25
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,222
  • 2
  • 18
  • 30
1

(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 Puche
  • 1,199
  • 13
  • 16
-1

Follow these simple steps :

  1. Check the JRE-> bin folder or bin folder where keytool.exe is present. copy the folder path and change directory of terminal with these path.
  2. keytool -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore

Type above command and take your sha-256 or sha-1 fingerprints.