SHA1 Key for DEBUG & RELEASE ANDROID STUDIO MAC , How to generate SHA1 Release Keys in Mac?
DEBUG:
Click on the Gradle tab on the right hand side of the view.
Go to the ROOT folder -> Tasks -> android -> signingReport
Double click, this will build with the signingReport and post in your bottom view your SHA1.
RELEASE:
In android studio. Build -> Generate Signed APK... and click Next
Copy your key store path and key alias.
Traverse to the "bin" folder of the jdk path present in Java.
Open terminal and enter:
keytool -list -v -keystore "key store path" -alias "key alias"
Enter your key password and this will print out your release SHA1.
SHA-1 fingerprint of keystore certificate
Follow this tutorial for creating SHA1 fingerprint for Google Map v2
For Debug mode:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
for Release mode:
keytool -list -v -keystore {keystore_name} -alias {alias_name}
example:
keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test
On windows, when keytool command is not found, Go to your installed JDK Directory e.g.
<YourJDKPath>\Java\jdk1.8.0_231\bin\
, open command line and try the above commands for debug/release mode.
Another way of getting your SHA1 OR SHA-256 use ./gradlew signingReport
For more detailed info visit
Using Gradle's Signing Report
How to generate a different debug sha1-key
Step 1) Go to File > Project Structure > select project > go to
"signing" and select your default or any keystore you want and fill
all the details. In case you are not able to fill the details, hit the
green '+' button.Step 2) VERY IMPORTANT: Goto Build Types> select your build type and
select your "Signing Config".
https://stackoverflow.com/a/17992232/4853835
Another solution: you can move (move to a backup folder) keys from this directory then build your project (Android studio will create new key):
- For Windows User: C:\Users\USERNAME.android\debug.keystore (Change USERNAME as your pc name)
- For Linux or Mac OS User: ~/.android/debug.keystore
Get SHA1 fingerprint certificate in Android Studio for Google Maps
I got my Answer, it was quit simple.
Open Terminal,
Type command:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Press Enter: You will get the following info, and SHA1 can be seen there.
.....
Certificate fingerprints:
MD5: 79:F5:59:................FE:09:D1:EC
SHA1: 33:57:0A:C9:..................:91:47:14:CD
SHA256: 39:AA:23:88:D6:...................33:DF:61:24:CB:17:47:EA:39:94:99
.......
How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?
Easiest ways ever:
Update added for Android Studio V 2.2 in last step
There are two ways to do this.
1. Faster way:
- Open Android Studio
- Open your Project
- Click on Gradle (From Right Side Panel, you will see Gradle Bar)
- Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project)
- Click on Your Project (Your Project Name form List (root))
- Click on Tasks
- Click on Android
- Double Click on signingReport (You will get SHA1 and MD5 in Run Bar(Sometimes it will be in Gradle Console))
- Select app module from module selection dropdown to run or debug your application
Check the screenshot below:
2. Work with Google Maps Activity:
- Open Android Studio
- Open Your Project
- Click on File menu -> Select New -> Click on Google -> Select Google Maps Activity
- A dialog would appear -> Click on Finish
- Android Studio would automatically generate an XML file named with
google_maps_api.xml
- You would get debug SHA1 key here (at line number 10 of the XML file)
Check Screenshot below:
Android Studio V 2.2 Update
There is an issue with Execution.
Solution:
- Click on Toggle tasks execution/text mode from Run bar
Check Screenshot below:
Done.
How to generate SHA1, SHA256, MD5 for default debug key using keytool in Mac, Windows and Linux?
Following will give you SHA1, SHA256, MD5 for default debug key.
And it can be used for developing and debugging with google play services.
Linux & Mac command
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Windows
keytool -exportcert -keystore C:\Users\<USERNAME>\.android\debug.keystore -list -v
Replace with your windows account name example:
keytool -exportcert -keystore C:\Users\Aakash\.android\debug.keystore -list -v
If asked password, type: android
Generate SHA-1 for Flutter/React-Native/Android-Native app
TERMINAL
Go to the project folder in the terminal.
Mackeytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Windowskeytool -list -v -keystore "\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Linuxkeytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
GUI Android Studio.
- Select android/app/build.gradle file and on the right top corner click "Open for Editing in Android Studio"
- Open Gradle panel and double click on "SigninReport",
see Android studio Gradle Tab
- That's it! If you use Firebase - add these 2 keys there. You should add both keys, otherwise, without the release key, Google login will not work on the devices.
How to Get SHA-1 key in React Native cli?
Windows:
– Open a terminal window– Change the directory to the JDK bin directory. The path of the JDK depends upon the operating system you are using
cd C:\Program Files\Java\jdk1.8.0_121\bin
– Now we have to run the following command using the keytool.exe file in JDK/bin
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Ubuntu/Mac
– Open a terminal window
– Now run the following command
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
For more details click Here
From React-native Project:
– Run this command in React-Native App directorycd android && ./gradlew signingReport
– copy the SHA1 from the debug key (This generates two variant keys. You can copy the 'SHA1' that belongs to the debugAndroidTest variant key option.)
Generate release SHA1 certificate using Android studio
Select your buildVariant
to release types. Then go to Project structure -> Default config -> SigninConfig -> and then select your release signinConfig for Release SHA1 and debug signinConfig for Debug SHA1.
Related Topics
How to Dismiss a Progress Bar Even If There Is No View to Populate in the Firebaselistadapter
Current Month Facebook Friends Birthdays in Android
How to Have Searched Characters Colored When We Use Searchview in Recyclerview
Gradle Dsl Method Not Found: 'Runproguard'
Android:Locationmanager VS Google Play Services
Add Shadow to Custom Shape on Android
Debugging SQLite Database on the Device
Android Get Current Locale, Not Default
Android Facebook 4.0 Sdk How to Get Email, Date of Birth and Gender of User
Android Action Bar Not Showing Overflow
Launch Android Application Without Main Activity and Start Service on Launching Application
How to Make a Horizontal Listview in Android
Android Spanned, Spannedstring, Spannable, Spannablestring and Charsequence
Force Update of an Android App When a New Version Is Available
Recyclerview Inside Scrollview Not Scrolling Smoothly