Related
Hello guys I have started a new project and its a firebase project I need SHA-1 and SHA-256 Keys for authentication before I was able to find in gradle tools but am not able to find here. I have even generated a signed build but still am not able to find those keys. I hope these are necessary information for my question.
In the current Android Studio version , for getting SHA-1 and SHA-26 you can do following :
Step 1 : Click on Execute Gradle Task Icon (The Elephant Icon)
and then Step 2 :
type command
gradlew signingReport
and post gradle sync you will get the certificates in the Build section
You can get SHA26 by using keytools using cmd and the command below.
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
I tried to get my SHA-1 key by using the terminal but I don't know what problem is there, can anyone help me with this? I know how to get sha-1 key in android studio by signing report, but I want to generate in terminal.
Here is what I got when I run the command, I tried this answer but got nothing: how to get sha1 of android app in Vs code
above is my cmd. It is saying that it is an illegal option.
I have my Java bin directory here C:\Program Files\Java\jdk-14.0.2\bin and debug.keystore here: C:\Users\91819\.android
Put a space between "C:\Users\91819\.android\debug.keystore" and -alias
open the Project folder in VS code
Open the Terminal
Enter the following cmd and enter
keytool -list -v -keystore "C:\Users\yourusernamehere\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Replace yourusernamehere to your windows user name
you will get the SHA1 and other details.
I'm trying to generate a SHA-1 for a Flutter app, for Android studio to support Google Sign in, but I don't know how to do that, I saw some posts that indicate to run a command, but there I need a jks file I guess, and flutter doesn't create that.
Could someone help me?
TERMINAL
Go to the project folder in the terminal.
Mac
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Windows
keytool -list -v -keystore "\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Linux
keytool -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.
This is the easiest way-
Open Android Studio
Open Project
Reveal android folder
Right click "gradlew" file and select Open in Terminal -
Go to the terminal view and paste: gradlew signingReport
(edit based on Venkat D. suggestion below: on unix-based systems like mac, you need to specify the current directory like this- ./gradlew signingReport)
Press enter and scroll to "Variant: debug" to get the SHA1 key
Copy and use wherever you need it, Good Luck!
You won't find a gradle window view in flutter project, so here is a solution for that.. In command prompt navigate to bin folder of jdk and run this command
keytool -list -v -keystore "C:\Users\yourusernamehere\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
change user name in path
I partially agree with Rishab answer, but what we can do is
and this approach works with all flutter/React-native/Android ....
Navigate to Android folder inside project, there is gradlew file. so we can use this like :
gradlew signingReport
in Mac
./gradlew signingReport
in my case i use it like :
D:\flutter\flutter_app\android>gradlew signingReport
Project Architecture is :
so if you are using an android studio or VS code it's work both of them
=> Open Terminal
=> cd android
=> signingReport
and the final output like this as given in the image below choice your SSH key in at the place of here is your SSH key
in the above output, image is shown in dummy data I change some of the fields just because of security purpose
Edit: for mac
./gradlew signingReport
run this commend
it work any where
in android folder
./gradlew signingReport
for example
PS E:\flutterProject\flutter_app\android> ./gradlew signingReport
some time you not need add ./ just
gradlew signingReport
this work for android studio and cmd and commond prome
you can do the same on VSCode, open the folder that contain gradlew for linux and gradlew.bat for windows and run ./gradlew signingReport for Window and run gradlew signingReport for Linux
1-write those two commands in android studio's or vscode terminal:
cd android
gradlew signingReport
2-wait a bit then scroll up.
in linuix
cd android
./gradlew signingReport
Simple and easy:
cd android && gradlew signinReport
For Android Studio 4.2 and Flutter 2.2
Windows:
Open your project open android > gradlew > right click on it and click open in terminal
Like below:
My Project Directory: D:\AndroidStudioProjects\WowTalentNew\android>gradlew
open this in terminal.
After build finished execute this
D:\AndroidStudioProjects\YourProjectDirectory\android>gradlew signinReport
After that you will see the SHA keys
Here's my full CMD screen
Microsoft Windows [Version 10.0.19043.985]
(c) Microsoft Corporation. All rights reserved.
D:\AndroidStudioProjects\WowTalentNew\android>gradlew
> Configure project :app
WARNING: The option setting 'android.enableR8=true' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
> Task :help
Welcome to Gradle 6.3.
To run a build, run gradlew <task> ...
To see a list of available tasks, run gradlew tasks
To see a list of command-line options, run gradlew --help
To see more detail about a task, run gradlew help --task <task>
For troubleshooting, visit https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle
7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See
BUILD SUCCESSFUL in 6s
1 actionable task: 1 executed
D:\AndroidStudioProjects\WowTalentNew\android>gradlew signinReport
> Configure project :app
WARNING: The option setting 'android.enableR8=true' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
> Task :app:signingReport
Variant: debugAndroidTest
Config: debug
Store: C:\Users\apoor\.android\debug.keystore
Alias: AndroidDebugKey
MD5: 2A:97:87:DF:E1:58:D4:9D:E6:65:18:********
SHA1: 4E:0E:D0:F7:68:51:80:47:3E:D1:**************************
SHA-256:
17:83:42:F4:0E:59:C5:5B:1E********************************************************
BC:79
Valid until: Saturday, November 26, 2050
in Linux instead of just type gradlew we write ./gradlew to build. and to get SHA-1 we write: Terminal> ./gradlew signinReport and we could just build and get SHA-1 key with just one command: Terminal> ./gradlew signinReport
I hope it clears everything, happy coding!
To generate SHA-1 for a Flutter :
1. Locate your android directory inside the console
E:\<appname>\android>
2. After locating to the android folder run this command
./gradlew signingReport
If this won't work and opens a daemon terminal
1. Type signingReport in daemon terminal
daemon> signingReport
This would be taking a bit long time to generate your first SHA-1 as it
would be checking for all the firebase dependencies and after that
over it generate the SHA-1.
Check this Authenticating Your Client | Google APIs for Android
To get the debug certificate fingerprint:
for Mac or Linux
keytool -list -v \ -alias androiddebugkey -keystore ~/.android/debug.keystore
for Windows
keytool -list -v \ -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
The default password for the debug keystore is android.
The keytool then prints the fingerprint to the terminal.
1. First Methord
just run the below command
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
2. Second Methord
1. Left side
open the android folder not the whole project in android studio.
2. Right Side open the file android/app/Tasks/anroid/signingReport
Final this process will take some time and it might be of 5-10 minutes so be patient
This solution work for me in MAC os Monterey and Android studio Bumblebee
open the android folder in terminal
right click on Android folder>Open In>Terminal
it will open new terminal window
and run below command
bash ./gradlew signingreport
You can generate it even from terminal. Following is for the release mode:
keytool -list -v -keystore keystore_location -alias alias_name
example :
keytool -list -v -keystore /home/user/key.jks -alias alias_name
Method 1
Make sure java is installed in your system.
Method 2
Using Command-line change your username and run the below command
keytool -list -v -alias androiddebugkey -keystore C:\Users\YOURUSERNAME\.android\debug.keystore
the default password is android
go to the android folder in terminal
cd android
.\gradlew signingReport
it will generate your SHA1 and SHA256 for you
First, check which Keystore is being used by your project in
Then use the below command
keytool -list -v -alias mstoreappsemoAlias -keystore fluxstorepro/android/app/mstoresemoFile.keystore
and if you want to generate a hash key for Facebook then use the below command
keytool -exportcert -alias mstoreappsemoAlias -keystore fluxstorepro/android/app/mstoresemoFile.keystore | openssl sha1 -binary | openssl base64
To get generate a SHA-1 key
in the terminal type cd android and change the path then type ./gradlew signingReport
If you have the keystore file, then run keytool -list -v -keystore fileName.jks -alias upload -storepass password -keypass password at the keystore file location...
Flutter Project Using MAC & VS Code
Step One
Go To the Android Gradle Properties and add this line
https://services.gradle.org/distributions/gradle-6.3-all.zip
Step Two
Open the Terminal at android Folder of your Projects .
then in the terminal type
.\gradlew signinReport
you will get the signing report Like this :
try writing this in Terminal - For Windows
cd android
gradlew signingReport
For Mac Users
If after typing ./gralew signingReport inside android folder gives you this error:
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
Then follow this process:
Run flutter doctor -v
Now inside the Android toolchain copy the location after Java binary at:. It will be something like this:
/Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
Paste it in the project's root location and Replace the java at the end of the above location with keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android.
You are done, you will see the keys now.
for linux:
if you are using vscode you can right-click on gradlew->copypath (in my case: /home/alif/Documents/project/flutter/fit_app/android/gradlew)
open your terminal and paste it, don't forget to delete /gradlew
type .../android gradlew signinReport and hit enter
good luck!
I found that I needed to check the fingerprint in Google Play Console, since I have Google Play managed app signing.
The ones provided by gradlew did not work for me.
Note that you can put both in Firebase, but you only need one. I just added the SHA1 and Google Sign In began working.
Personally, I went to the terminal then navigated to C:\Program Files\Java\jdk-14.0.2\bin (navigate to your java bin folder).
Next, I ran this command and it worked: keytool -list -v -keystore "%USERPROFILE%.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
gradlew signingReport
Use this command on Terminal which you can find in bottom left corner.
You can use one line in terminal
echo y | keytool -genkeypair -dname "cn=Chris, ou=JavaSoft, o=Sun, c=US" -alias business -keypass kpi135 -keystore /working/android.keystore -storepass ab987c -validity 20000
dname is a unique identifier for the application in the .keystore
cn the full name of the person or organization that generates the
.keystore
ou Organizational Unit that creates the project, its a subdivision of
the Organization that creates it. Ex. android.google.com
o Organization owner of the whole project. Its a higher scope than
ou. Ex.: google.com
c The country short code. Ex: For United States is "US"
alias Identifier of the app as an single entity inside the .keystore
(it can have many)
keypass Password for protecting that specific alias.
keystore Path where the .keystore file shall be created (the standard
extension is actually .ks)
storepass Password for protecting the whole .keystore content.
validity Amout of days the app will be valid with this .keystore
Solution for Windows Flutter 2022-23 solution to get SHA-1
First solution:-
In your project terminal type cd android
now you're inside the android folder now type ./gradlew then type
gradlew signinReport
IF you got this error then try next solution
second solution
Again type cd android in your root project
Now type ./gradlew signingReport
you will surely get SHA-1
If you are using flutter I hope it will work for you,
If you are using vs code then open terminal or if you are using other stuff then Goto the project folder and open terminal and past below code
keytool -list -v -keystore "C:\Users%your user name%.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
It's work for me. i think will work for you also.
Windows 10
Firebase
I want to create Firebase project.
So I use this official documentaion:
Manually add Firebase
Steps:
Go to Firebase consle
Click create new project
Create new applications
Select Android
Input name: com.myproject
I need to input debug signing certificate SHA-1:
Here screen:
So I open shell and input:
keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
But I get error:
keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
keytool error: java.lang.Exception: Keystore file does not exist: ~/.android/debug.keystore
java.lang.Exception: Keystore file does not exist: ~/.android/debug.keystore
at sun.security.tools.keytool.Main.doCommands(Main.java:745)
at sun.security.tools.keytool.Main.run(Main.java:343)
at sun.security.tools.keytool.Main.main(Main.java:336)
What is wrong?
In my home folder no file "debug.keystore". So how I can get hash?
Android Studio will do the SHA key generating part to save your time and effort.
You've to find Gradle Project tab somewhere at the right edge of your Android studio. Open it up.
Under your project(root)>Tasks>android, find something called signingReport and run it by double clicking on it.
You will find your SHA1 and MD5 certificates in the Run section, below.
Copy the SHA1 and use it. Otherwise, debug signing certificate SHA-1 is optional in this case, so you can continue without this.
maybe you can try this, go to the right side of your android studio and then double click the signingReport
and you will find the SHA-1 here,
hope this help your problem
Have you tried out this guide as suggested in this solution?
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Edited:
A rather extensive guide on the same topic have been made here. I've personally succeeded with this on Win10 in Android Studio.
I'm trying to register my android app following the steps in https://developers.google.com/console/help/#installed_applications which leads me to follow
http://developer.android.com/tools/publishing/app-signing.html.
However, I'm not sure how to get the signing certificate fingerprint (SHA1).
I first used the Eclipse ADT plugin to export and create the keystore/key.
Then, I tried doing keytool -list keystore mykeystore.keystore and it gives me a MD5 Certificate fingerprint. Do I need to redo the signing (meaning I can't use the eclipse export wizard)?
Can I use a debug certificate first?
Start an export process to create an apk for your app and use your production key. The very last page displays both your SHA1 and MD5 certificate fingerprints
I know this question has been answered but this is how I found my signature for the default keystore. In Eclipse, if you go to Windows -> Preferences -> Android -> Build
I think this will work perfectly. I used the same:
For Android Studio:
Click on Build > Generate Signed APK.
You will get a message box, just click OK.
Now there will be another window just copy Key Store Path.
Now open a command prompt and go to C:\Program
Files\Java\jdk1.6.0_39\bin> (or any installed jdk version).
Type keytool -list -v -keystore and then paste your Key Store
Path (Eg. C:\Program Files\Java\jdk1.6.0_39\bin>keytool -list -v
-keystore "E:\My Projects \Android\android studio\signed apks\Hello World\HelloWorld.jks").
Now it will Ask Key Store Password, provide yours and press Enter to get your SHA1 and MD5 Certificate keys.
If you are using Mac or even Linux, just copy and paste this onto the Terminal application and you will get the SHA1 key immediately. No need to change anything.
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Example output:
Alias name: androiddebugkey
Creation date: 17 Feb 12
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: 4f3dfc69
Valid from: Fri Feb 17 15:06:17 SGT 2012 until: Sun Feb 09 15:06:17 SGT 2042
Certificate fingerprints:
MD5: 11:10:11:11:11:11:11:11:11:11:11:11:11:11:11:11
SHA1: 11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:01:11
Signature algorithm name: SHA1withRSA
Version: 3
use this in the command line
c:\Program Files\Java\jdk1.6.25\bin>keytool -list -v -keystore c:\you_key_here.key
Open terminal (in Unix, in MAC), (cmd in Windows) and cd to this (your java) path:
C:\Program Files\Java\jdk1.6.0_43\bin>
Run this command:
keytool -list -v -keystore C:\Users\leon\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
Just change the path to debug.keystore and you will get both MD5 and SHA-1 fingerprints.
keytool -list -v -keystore "keyStoreName"
Run this command from the directory where the keystore of your app exists.
In Android Studio, follow these steps:
Click Gradle properties menu at right side of your android studio IDE.
Expand Task tree.
Click on signingReport
You can see your SHA1 at the bottom console
See if you want to use Google Map at that time you need MD5 fingerprint for generating api kay for using google map in your android application.
Keytool command generated MD5 fingerprint if you use JDK 1.6 and it generates SHA1 fingerprint if you use JDK 1.7.
So the thing is that if you want to sign your application for publishing then read this.
And if you want to use google-map read this.
If you are using IntelliJ (12+?), go to menu Build/Generate signed Api
After filling a popup, get the data in the field "key store path" (e.g. C:\Users\user\Documents\store\store)
And run in a command line:
>keytool -list -v -keystore "C:\Users\user\Documents\store\store"
....
MD5: 11:C5:09:73:50:A4:E5:71:A2:26:13:E0:7B:CD:DD:6B
--> SHA1: 07:0B:0E:E8:F7:22:59:72:6A:1C:68:05:05:CF:2E:6F:59:43:48:99
SHA256: E6:CE:DA:37:C1:18:43:C1:A3:F0:9E:8F:1A:C2:69:AF:E6:41:F7:C0:18:
1D:1D:55:5D:F0:52:6C:EE:77:84:A7
...
Good luck
If any one using the Android studio...
click: Build > Generate Signed in APK
Create a new key: this will generated ".jks" files
Use following command to read the data(SHA1 and other info):
$ keytool -list -v -keystore filename.jks
For those using OpenSSL you can retrieve the SHA1 fingerprint this way:
OpenSSL> dgst -sha1 my-release-key.keystore
Which would result in the following output:
I was so confusing first time, but I propose you final working solution for Windows:
1) Open cmd and go to your Java/jdk/bin directory (just press cd .. to go one folder back and cd NAME_FOLDER to go one folder forward), in my case, final folder: C:\Program Files\Java\jdk1.8.0_73\bin>
2) Now type this command keytool -list -v -keystore C:\Users\YOUR_WINDOWS_USER\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
As result you have to get something like this:
Here is my easy solution for this:
Click on Gradle button, you can find at the right side top. you will see all the gradle files. Now go to android, and double click on signingReport. Once the gradle build finishes, you see the SHA key. Check the below images for step by step guide.
Once you click on Gradle check the below images. Hope this helps someone.
STEP 1:
STEP 2:
If you are using Android Studio. You can get fastly the SHA1 certificate fingerprint (debug,release... all Build Types!!) through Gradle Tasks:
signingReport
SHA1 is shown in Messages Logs
Android Plugin (configured in the gradle app) creates a debug mode for default.
com.android.application
File route to keystore:
HOME/.android/debug.keystore
I recommend attach debug.keystore to build.gradle. To do this put a file debug.keystore to a app folder and then Add SigningConfigs in gradle app:
apply plugin: 'com.android.application'
android {
................
signingConfigs {
debug {
storeFile file("../app/debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
release {
storeFile file("../app/debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
........
}
Extra: If you want creates for release, put a file release.keystore to a app folder. (This example uses the same debug.keystore)
If you are using Android Studio. You don't need to generate a SHA1 fingerprint using cmd prompt. You just need to create a project with default Maps Activity of Android Studio.In the project you can get the fingerprint in google_maps_api.xml under Values folder. Hope this will help you. :)
Try this One:
Windows----preferences----Android--build---sh1 code copy from here
I think this will work perfectly. I used the same:
For Android Studio:
Click on Build > Generate Signed APK.
You will get a message box, just click OK.
Now there will be another window just copy Key Store Path.
Now open a command prompt and go to C:\Program Files\Java\jdk1.6.0_39\bin> (or any installed jdk version).
Type keytool -list -v -keystore and then paste your Key Store Path (Eg. C:\Program Files\Java\jdk1.6.0_39\bin>keytool -list -v -keystore "E:\My Projects \Android\android studio\signed apks\Hello World\HelloWorld.jks").
Now it will Ask Key Store Password, provide yours and press Enter to get your SHA1 and MD5 Certificate keys.
Now add this SHA1 key to the google developers console in credentials tab and also change the build variants in android studio to release mode.
Please Click on Gradle from Right side of Menu
Then Click on :app
Then Click android folder
Then SigningReport file name is exist there
Double click on that.
It Will start executing and in a while it will show you SHA-1 Code
Just copy the code.
And paste it where you need it
For those on mac looking for keytool. follow these steps:
Firstly make sure to install Java JDK
http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html
Then type this into command prompt:
/usr/libexec/java_home -v 1.7
it will spit out something like:
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
keytool is located in the same directory as javac. ie:
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin
From bin directory you can use the keytool.
If you are on Mac/Linux, then you can get SHA1 fingerprint by writing following line in the terminal:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
There are 2 things possible after this
It will ask you for the password
Just type
android
and press enter, you can find the SHA1 key in the output shown below.
It will ask you to download a suitable program (and some list will
be given)
Just type following in terminal
sudo apt install openjdk-8-jre-headless
and then again run following in terminal: keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
This time, you will be led to step 1, where you need to just enter the password as
android
and you will get your SHA1 fingerprint below in the output.
Open your command prompt
Navigate working directory to 1.8.0/bin
paste keytool -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
Press enter if it ask you a password
If you want to obtain fingerprint-sha1 key from signing keystore.jks file
Run the following command from terminal:
keytool -list -v -keystore <.../path/keystore.jks>
Example
keytool -list -v -keystore /Users/Home/Projects/Keystore/myApp_keystore.jks
Enter keystore password:
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
Alias name:myApp_alias
Owner: CN=xxx, OU=xxx Dev, O=ZZZ, L=Dhaka, ST=Dhaka, C=BD
..........
Certificate fingerprints:
MD5: 12:10:11:12:11:11:11:11:11:11:33:11:11:11:11:11
SHA1: 11:44:11:11:55:11:17:11:11:66:11:11:88:11:11:77:11:11:01:11
.....................
Using portecle :
File > Open Keystore file
Enter Keystore password
Right click on alias name > Certificate details > SHA-1 Fingerprint
Easiest way to Get SHA-1 For Release and Debug mode android studio gradle. Check this
I wanted to post a notice to those that are having the same issue as me. I went through the steps to generate my debug SHA-1 and my release SHA-1. I was attempting to connect Google Sign-In API with my app.
I ran into the issue that the debug .apk would work fine, it would connect and authenticate with Google Sign-In. My release .apk would also work, when installed manually to the phone. When I posted my release .apk to the Google play store, my google Sign-in would not authenticate and I would get an issue!
For the longest time I couldn't figure it out, but I found that my app was being signed by google, i.e., the message on the top of the Developer console was showing: Google Play App Signing is enabled for this app.
I went to my Release Management tab, then scrolled down to App Signing, and found the SHA-1 there. After adding this to my code and on "firebase console" which I was using as the backend for Google Sign-in, everything seemed to work. It looks like my release keystore was getting replaced with the google signed certificate... I'm not really sure if this is what was happening, but it resolved my issue and allowed my Google Play Store release apk to correctly authenticate with the google sign in!
Step by step solution:
Open your command prompt or Terminal for Mac
Change directory to directory of the keytool file location. Change directory by using command cd <directory path>. (Note: if any directory name has space then add \ between the two words. Example cd /Applications/Android\ Studio.app//Contents/jre/jdk/Contents/Home/bin/)
To find the location of your keytool, you go to android studio..open your project. And go to
File>project Structure>SDK location..and find JDK location.
Run the keytool by this command:
keytool -list -v –keystore <your jks file path> (Note: if any directory name has space then add \ between the two words. example
keytool -list -v -keystore /Users/username/Desktop/tasmiah\ mobile/v3/jordanos.jks)
Command prompt you to key in the password.. so key in your password.. then you get the result
Here is tool for lazy coders:
1 add dependency:
compile 'com.vk:androidsdk:1.6.9'
2 add following lines somewhere in your activity/application:
String[] fingerprints = VKUtil.getCertificateFingerprint(this, getPackageName());
Log.d("SHA1", fingerprints[0]);
3 Open logcat and catch message.
4 Profit!
In latest version of Android Studio best way to get the SHA-1 key is form terminal. ,
open terminal in Android studio
Copy the
command( keytool -list -v -keystore ~/.android/debug.keystore -alias
androiddebugkey -storepass android -keypass android)
Paster it on terminal and press the enter key