Need google+ sign in for my phonegap application for that I want to generate Certificate SHA-1.I run
keytool -exportcert -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore
the command to generate Android Signing Certificate SHA-1, but it gave an error
Keystore file does not exist: /root/.android/debug.keystore
so I search for that file using find ~ -name "debug.keystore" but my search result is empty.
I also tried below command
keytool -genkey -alias myKey -keystore store.jks
keytool -selfcert -alias myKey -keystore store.jks
but i didn't found Android Signing Certificate SHA-1
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Try this command. Your debug keystore is always present in /home/<username>/.android and ~ is just a shorthand for /home/<username>.
If your SDK is installed properly, there should be no issues in running that command. Otherwise, we'll need some more information to find and fix the issue.
If PhoneGap/Meteor has its own set of android bundles, you might want to try something on these lines
keytool -list -v -keystore ~/.meteor/android_bundle/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
You don't have to use the debug certificate, just create a new certificate by following this tutorial and use it to sign your debug and release versions of the app.
I am using Android Studio on Mac El Capitan. How do I get the release Certificate Fingerprints? I need it for Firebase. I am not sure exactly how to get it.
Just to test it (with the debug fingerprint), run the following command in any directory with the terminal.
$ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v
Then copy the SHA1 value and paste it into your Firebase console.
Be careful, the above will work for the debug environment, if you want to set up the release fingerprint you will have to create a keystore, check out this post to see how to do it, and then run the same command but instead of ~/.android/debug.keystore you should put ~/YOUR/PATH/TO/KEYSTORE
$ keytool -exportcert -alias androiddebugkey -keystore ~/YOUR/PATH/TO/KEYSTORE -list -v
Android: What is a keystore file, and what is it used for?
As this question is to get RELEASE certificate fingerprint, easy way to get RELEASE fingerprint is,
Open terminal
Go to directory where project's .jks file located
Finally get it by,
keytool -exportcert -alias ALIAS_NAME -keystore KEYSTORE_NAME_WITH_EXTENSION -list -v
Example :
ALIAS_NAME_HERE : kakha
KEY_FULL_PATH : C:\Users\kakha\key.jks
keytool -exportcert -alias "ALIAS_NAME_HERE"-keystore "KEY_FULL_PATH" -list -v
as #lasec0203 said, you dont need to use alias...
Just use this code;
keytool -list -v -keystore "/fullpath/upload-keystore.jks"
and after that, enter your keystore than you will get the your certificate fingerprint.
I am trying to add google authentication feature in my android app and for that I need to get the Android Signing certificate SHA-1. The official tutorial says to use the below command to get the SHA-1 hash value .
In release mode
keytool -exportcert -list -v \-alias <your-key-name> -keystore <path-to-production-keystore>
debug mode
keytool -exportcert -list -v \-alias androiddebugkey -keystore ~/.android/debug.keystore
Now I am confused with what is this production-keystore and debug.keystore and how to get the path to production-keystore? Explanations are appreciated.
Please use below command for linux, if you don't have keystore file:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Production keystore will generate when you are creating signed APK file.
Refer below link for information:
http://developer.android.com/tools/publishing/app-signing.html
Stumble upon this but I was using Windows. I got my answer hoping to help other Windows user who came to this post.
keytool -list -v -alias androiddebugkey -keystore C:\Users\<name>\.android\debug.keystore
I'm trying to get the SHA1 fingerprint so I can get an Google API key.
Im in the following directory:
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin
Then I execute the command from the google site :
keytool -list -v -keystore mystore.keystore
But it gives this error:
keytool error: java.lang.Exception: Keystore file does not exist: mystore.keystore
java.lang.Exception: Keystore file does not exist: mystore.keystore
at sun.security.tools.keytool.Main.doCommands(Main.java:742)
at sun.security.tools.keytool.Main.run(Main.java:340)
at sun.security.tools.keytool.Main.main(Main.java:333)
I followed tutorials but I can't get it to work!
Does anyone know what I am doing wrong?
BTW: I'm using a Macbook Pro with Xamarin Studio 5.5.2.
Linux & Mac command
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Will give you SHA1, SHA256, MD5 for default debug key. And it can be used for developing and debugging with google play services.
For publication certificate just follow https://developer.android.com/studio/publish/app-signing.html
You said you are running the command from...
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin
Is your keystore file in that directory as well? If not then you need to specify the path to the keystore file, e.g.
keytool -list -v -keystore ~/somefolder/mystore.keystore
The keystore used should be the one used to sign the app. For Xamarin debug builds this will be the debug keystore located at /Users/[USERNAME]/.local/share/Xamarin/Mono\ for\ Android/debug.keystore. The command on OSX for this would be...
keytool -list -v -keystore /Users/[USERNAME]/.local/share/Xamarin/Mono\ for\ Android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Or on Windows 7
keytool -list -v -keystore C:\Users\[USERNAME]\AppData\Local\Xamarin\Mono for Android\debug.keystore -alias androiddebugkey -storepass android -keypass android
I faced the same issue, but resolved via following command:
keytool -exportcert -keystore C:\Users\<USERNAME>\.android\debug.keystore -list -v
OS: Windows 7
I have windows 10, I went to the route
c:/Users/usuario/.android/
Inside directory, execute command:
keytool -exportcert -keystore debug.keystore -list -v
Must generate fingerprint:
SHA-1: 73:BE:1A:.......................
MDO: 73:BE:A1.........................
SHA-256: 3B:B8:98:...................
Please provide the complete path of debug.keystore.
Example: C:/Users/myusername/.android/debug.keystore instead of ~/.android/debug.keystore
In my case the debug.keystore is generated after the first run of the app on Android Studio
I had the same issue.
My error was
keytool error: java.lang.Exception: Keystore file does not exist:/Users/[USER_NAME]/.android/debug.keystore java.lang.Exception: Keystore
file does not exist: /Users/[USER_NAME]/.android/debug.keystore
at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:910)
at java.base/sun.security.tools.keytool.Main.run(Main.java:416)
at java.base/sun.security.tools.keytool.Main.main(Main.java:409)
I checked my /Users/[USER_NAME]/.android/ directory and I couldn't find debug.keystore file there.
Reason:
I used VSCODE and I did run my application only for iOS through iOS Simulator.
Solution:
I opened Android Studio and run my application for android with Android Emulator.
Then I got debug.keystore file in my .android/ directory.
Then I tried command below again:
keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
And it runs without any error.
I hope it helps you.
I had the same error in Windows 10 as well. But sorted it and finally got SHA-1 Key.
I followed these steps
1.Open C drive and follow this path C:\Program Files\Java\jdk1.8.0_201\bin .
2.Inside bin folder open CMD and run command keytool -exportcert -list -v -alias androiddebugkey -keystore C:/Users/Username/.android/debug.keystore . (Replace Username with your username).
3.Enter password as android .
Linux or Mac or Windows, use complete path
Mac:
keytool -list -v -keystore /Users/username/.android/debug.keystore
-alias androiddebugkey -storepass android -keypass android
Linux (Ubuntu in my case):
keytool -list -v -keystore /home/username/.android/debug.keystore
-alias androiddebugkey -storepass android -keypass android
Windows:
keytool -list -v -keystore C:\Users\username\.android\debug.keystore
-alias androiddebugkey -storepass android -keypass android
Hope it work for you!
I found this guide from teamtreehouse forum. hope it'll help you.
1) Open Command Prompt by pressing Start+R and typing cmd.exe.
2) Using Windows Explorer, find where your JDK directory is located (Usually Program Files >> Java) and copy the path.
3) In Command Prompt, type cd followed by the directory of your JDK’s bin directory. e.g: cd C:\Program Files\Java\jdk1.8.0_25\bin is the command I use (Yours may vary).
4) Using Windows Explorer, find where your .android directory is located (Usually under Users >> [YOUR WINDOWS USERNAME]) and copy the path.
5) Now, use this command below:
keytool -exportcert -alias androiddebugkey -keystore[PATH_TO_.ANDROID_DIRECTORY] -list -v
Replacing [PATH_TO_.ANDROID_DIRECTORY] with the path you copied. Note that you should be running this command in terminal/command prompt in your JDK’s bin directory (You did this in Step 3).
Mine is C:\Program Files\Java\jdk1.8.0_121\bin>keytool -exportcert -alias androiddebugkey -keystore C:\Users\HoSiLuan\.android\debug.keystore -list -v
Remember to use C:\Users\HoSiLuan\.android\debug.keystore instead of ~/.android\debug.keystore. I still got the error when type this shorten way.
You should then be prompted with the password as normal which you can enter (The password is android) . After that, you’ll see the list of certificates printed to the screen.
If you are on Windows open command prompt and RUN AS ADMINISTRATOR then paste the line keytool -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore. That should work, it worked for me
I lived same problem on Windows 10 and solved that problem with writing below command:
keytool -list -keystore debug.keystore
I think with some other commands java couldn't find debug.keystore file but interestingly with that command it works for me.
I had the same Error
am using ubuntu 18.04
Solution:
Open terminal and navigate to /home/{$user}/.android
Then run the command
keytool -list -v \ -alias androiddebugkey -keystore ~/.android/debug.keystore
You will be prompted to enter a keystore password enter android
Hope this helps.
Below command should work:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
So I have found the solution.
On Windows, open cmd from start menu and write cd C:\Users\put_here_your_username\.android and then write
keytool -list -v -keystore ".\debug.keystore" -alias androiddebugkey -storepass android -keypass android
last update for Mac & Ubuntu
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v
I faced the same problem, I found that I had .android folder inside another .android folder. Make sure to find the right path of debug.keystore file on your system
I used this command and it worked
keytool -list -v -alias androiddebugkey -keystore C:\Users\User.android.android\debug.keystore
keytool -list -v -keystore C:\Users\%USERNAME%\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
Try this to get resolve from the problem
If you are on Windows open command prompt and then Run it as an administration then paste this: keytool -list -v -alias androiddebugkey -keystore %USERPROFILE%.android\debug.keystore
use password : android
then you will get SHA-1 and SHA-256 this worked smoothly for me.
Install keytool on your system
Keytool is included as part of the Java runtime. So by installing Java, you'll also have keytool in your system.
To install Java, visit the JAVA SE Downloads page. Then, select the JDK Download link.
After that, add the keytool folder to your system %PATH% (on Windows). In order to run keytool from the command line, you need to add it to your system PATH. This step is required on Windows only.
Finally, run this command in a terminal, and don't forget to change the user name to your own:
keytool -list -v -keystore "c:\users\your_user_name\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Open CMD and navigate to Java bin folder for example:
C:\Program Files\Java\jre1.8.0_341\bin
Once you stand here then paste this:
keytool -exportcert -list -v -alias androiddebugkey -keystore C:/Users/*YOUR_PC_USERNAME*/.android/debug.keystore
Do not forget to change to your own PC username marked with * YOUR_PC_USERNAME *
Double check that you are putting the correct address in my case I had two typos and that fixed it.
I had c:User instead of C:\Users\
Find your debug.keystore file by searching (usually it is in .android) and then use this
keytool -list -v -alias androiddebugkey -keystore "C:\Users\u_name\ .android\debug.keystore"
Use your own full path name not copy paste from anywhere.
It solved mine and this or some else solution will solve yours too😄.
just put this given command in your package.json file and hit run yarn sha-keys
"sha-keys": "keytool -list -v -keystore ./android/App/debug.keystore -alias androiddebugkey -storepass android -keypass android",
I am following this tutorial here:
http://www.vogella.com/articles/AndroidGoogleMaps/article.html
On my mac and am not sure how to accomplish this step to get my sha-1:
Update:
I realized I already have a key cause I build and sign my project. Trying to get the SHA-1 is proving difficult with the terminal on my mac:
Mikes-MacBook-Air:beerPortfolio Mike$ keytool -list -v -alias androiddebugkey \ -keystore bp_key.keystore \ -storepass android -keypass android
keytool error: java.lang.RuntimeException: Usage error, -keystore is not a legal command
java.lang.RuntimeException: Usage error, -keystore is not a legal command
at sun.security.tools.KeyTool.parseArgs(KeyTool.java:375)
at sun.security.tools.KeyTool.run(KeyTool.java:171)
at sun.security.tools.KeyTool.main(KeyTool.java:166)
Mikes-MacBook-Air:beerPortfolio Mike$
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
The above command worked for me. You can change your keystore path if it is in another location.
Here is the Link