Reputation: 12022
I am trying to make a Map app in Android Studio, on Windows. How can I find the SHA-1 fingerprint certificate number?
When I was using Eclipse it was right under Windows -> Preferences -> Android -> Build. But in Android Studio I couldn't find a similar option.
I read in the documentation that
Android Studio signs your app in debug mode automatically when you run or debug your project from the IDE.
So I tried setting my Java bin path and running the following command, taken from here:
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
However, I got an error message saying that it is an illegal option.
Step by step, how do I get this information in Android Studio?
As a workaround: I previously registered my app using the SHA-1 fingerprint generated by Eclipse. Can I use the same API key to work on my project in Android Studio?
Upvotes: 747
Views: 1171820
Reputation: 76
This is Quickest way to get SHA-1 in Android studio - Follow steps below:
./gradlew signingReport
The SHA-1 for both debug and release build types will be displayed, along with other details like SHA-256 and MD5.
Upvotes: 3
Reputation: 6742
----------------------------------------EDITED 2024--------------------------------------
For the latest Android versions 2024.1.1 and latest.
3)Click on it and write the command "gradle signingreport". And Your signing result for Debug and Release will be generated.
--------------------------------------------------------Old------------------------------------------------
Many Users has given their answers and it's working fine in Android Studio's version below 4.2. But for Android Studio 4.2 and newer version ,follows these steps to generate SHA Key . Steps are given in these pictures.
Steps:-
1) Click on the gradle. Top right on the Android Studio. As you can see in this picture.
2) Now click on icon as seen in below picture. A new searchable windows/screen will open.
3) Now type,gradle signingreport and press Enter to start generating SHA KEY as seen in below picture.
4) Your SHA Key will generate as seen in this picture. Using these steps you can generate SHA KEY in Android Studio 4.2.
Note:- If you want to get SHA KEY for Flutter/ React native projects. Follow these steps:--
1)Open Android Folder
2)Click on gradlew and Open it in Terminal
3)Type the command "./gradlew signingreport" and you will get the SHA KEY for different Varient and Config
Upvotes: 396
Reputation: 31
Get SHA1 and SHA-256 fingerprint certificate in Android Studio/Flutter
In Flutter
Step 1 : go to Android -> app -> build.gradle -> open for editing in Android studio
Step 2 : Click on Gradle -> Execute Gradle Task -> write gradle signingReport
Upvotes: 2
Reputation: 1827
One line to get it.
In the terminal type this command
gradle signingReport
very important
press Ctrl + enter ⚠ not enter only
Work with Mac And Windows
Upvotes: 40
Reputation: 126
open the Android Studio terminal and type this command -
./gradlew signingreport
Upvotes: 4
Reputation: 171
I tried almost all the ways which were given by other developers, but it was not successful. I run :
keytool -list -v \
-alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
Which is for Windows. But I got error message saying: 'keytool' is not recognized as an internal or external command, operable program or batch file. Then I download JDK (Java Development Kit) for running this command. I updated my path also. Here is the steps how you can do that:
Open the System Properties window.
Click on the Advanced tab.
Click on the Environment Variables button.
In the System variable section, scroll down and find the PATH variable.
Click on the Edit button.
In the Edit environment variable dialog box, add the path to the keytool executable to the Value field. The path is usually something like C:\Program Files\Java\jdk-20\bin.
Click on the OK button to close the Edit environment variable dialog box.
Click on the OK button to close the Environment Variables dialog box.
Close the System Properties window. Then I run the same command:
keytool -list -v
-alias androiddebugkey -keystore %USERPROFILE%.android\debug.keystore
This time I got another error message:
Finally I changed command to this :
keytool -list -v -alias androiddebugkey -keystore
"%USERPROFILE%\.android\debug.keystore"
Upvotes: 0
Reputation: 676
The easiest way is
From left side click on project folder >> android then right-click on gradlew folder and select open in terminal
paste it into terminal './gradlew signingReport'
Good Luck
Upvotes: 11
Reputation: 51
Here is the full process to generate SHA-1 and MD5 key in latest - 2023 android studio.
Upvotes: 1
Reputation: 1349
Steps:
Upvotes: 0
Reputation: 1605
In Android Studio 4+ (not sure about version), if you click on Gradle
on the right bar, it won't show you any option to generate signing report. It will show you this:
Click on Task list not built...
info and un-check the option Do not build gradle task list..
and save the settings.
Then click gradle sync button:
Then you'll see the signingreport option:
Update for Android Studio Flamingo:
Option name changed
The option namely Only include test tasks in the Gradle task list generated during Gradle Syncs
that needs to be unchecked will look this:
Upvotes: 70
Reputation: 321
In Mac
keytool -list -v -keystore ~/Desktop/AppRelease/FolderName/app_key -alias userName -storepass pw -keypass pw
Upvotes: 1
Reputation: 3964
For me I was not getting signing report option in my android studio so I found very easy way to get SHA-1.
in terminal(of Android studio) execute this line :
./gradlew signingReport
Upvotes: 6
Reputation: 126563
Use the instructions from the API Manager using keytool:
Get the package name from your AndroidManifest.xml file. Then use the following command to get the fingerprint:
keytool -list -v -keystore mystore.keystore
Other option using the terminal of Android Studio
, using windows type :
.\gradlew signingReport
Very important press Ctrl + enter (Dont use only enter)
The you will get the SHA1
in the output
----------
Variant: IrinaIoanaDebugAndroidTest
Config: debug
Store: C:\Users\jorgesys\.android\debug.keystore
Alias: AndroidDebugKey
MD5: 12:D6:14:D5:87:CE:12:CC:8D:50:5D:CB:0E:D7:0B:3E
SHA1: 12:48:1F:75:26:E6:E2:D7:25:85:80:70:97:79:0A:5F:78:F7:51:7B
SHA-256: 12:5B:15:87:5E:E4:12:ED:79:DF:5E:B6:4B:9D:1E:FE:90:8C:67:FC:65:A8:53:79:54:02:98:22:6B:33:1E:6F
Valid until: Wednesday, September 11, 2052
----------
Upvotes: 11
Reputation: 2364
If you just want the SHA certificate values, run the following command from the android folder:
gradlew signingReport
...that'll give you a quick and easy view of your fingerprint
Upvotes: 52
Reputation: 1022
Follow the simple following steps to get SHA-1, SHA-256 & MD5:
Upvotes: 15
Reputation: 506
goto this website and find for yourself https://developers.google.com/android/guides/client-auth
method1 : ./gradlew signingReport
method2 :
(a) for mac/linux
keytool -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore
(b) for windows ==>
keytool -list -v \
-alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
password : android
Upvotes: 10
Reputation: 736
Above answers give me a command not found error The correct terminal command that works for me was
./gradlew signingReport
Upvotes: 21
Reputation: 123
You can open the terminal from the android studio and write this line:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Upvotes: 4
Reputation: 872
Recently Android Studio and in its last update 2020.3.1
has removed signingReport
from Gradle sidebar but you can still get these details in Android studio in Terminal
, just write the following command:
Windows:
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Linux & MacOS:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Upvotes: 13
Reputation: 524
Click on the Terminal icon on the bottom left corner
cd to the android folder and run
gradlew signingreport
Once this is done, it will print the SHA-1, MD5, and SHA-256 keys
Upvotes: 7
Reputation: 1126
For Android Studio 4.2 or new
Goto the Gradle on the right side
Open it and then Click on Execute Gradle Task and this pan is open
then you have to type signingreport and press enter this will execute the command and will provide the result.
For Older Version of Android Studio
You can follow all of the above steps on the older version to get your result.
Upvotes: 14
Reputation: 1113
Follow the following step
gradle(on the right corner) > click on your project name > Tasks > android > double click on signingReport
Then you will get SHA1 and other information in 4:Run(it will appear automatically).
Upvotes: 0
Reputation: 1133
for me the shortest way is to type ./gradlew signingReport
in the terminal command line.
P.s : if you are in Windows use .\gradlew signingReport
instead.
Upvotes: 63
Reputation: 8067
i am going with @Hiren Patel answer but slightly change in android studio 2.2 and later
Upvotes: 24
Reputation: 341
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Upvotes: 2
Reputation: 29
First Step Go your C drive open Program File ->Open JAVA Folder ->Open Bin and DoubleClick on jarsigner.exe
Then Open Cmd
Go to C:\Program Files\Java\jdk1.8.0_191\bin Then Enter Then Go C:\Program Files\Java\jdk1.8.0_191\bin>keytool -list -keystore "F:\BTG UPDATE BUILD\Beyond_The_Game.jks"
Enter JUST Show Enter Kaystoer Password ***** enter your PAssword enter finally Your Release SHA key Getting you Thank YOU
Upvotes: 1
Reputation: 1209
I did this way:
Step 1: Go to this folder
On Mac: /Users/<username>/.android/
On Windows: C:\Documents and Settings\<username>\.android\
On Linux: ~/.android/
Step 2: Run this command line:
keytool -list -v -keystore debug.keystore -storepass android
You will see the SHA-1 key.
Upvotes: 34
Reputation: 1489
Go to File > Project Structure
Select app
or mobile
whatever you gave the name from Modules
Choose Signing
tab.
You can add certificate clicking on the + button.
Upvotes: 2
Reputation: 5136
For Linux & Mac
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Upvotes: 29
Reputation: 2067
For Mac, this worked perfectly:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Upvotes: 195