Someone I'm helping with an application needs to locate her debug.keystore - mine is in my .android folder, but when I navigate there on her computer it is not there.
Does something need to be done in order for it to appear? Where is it / how can it be generated again?
According to the documentation, performing a build in Eclipse or using ant debug should automatically generate ~/.android/debug.keystore.
But in case this doesn't work, you can create one manually by running:
keytool -genkey -v -keystore ~/.android/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"
If she is using Eclipse then go to Windows -> Preferences
Select Android -> Build
There you will see Default debug keystore: "Path"
See if you can locate it there.
You can create keystore using this command..
keytool -genkey -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
The debug.keystore is created automatically on first build that uses it.
On Windows 7, I had to create the file manually using John's suggested command. Don't forget to enclose the path in a pair of double quotes (").
I don't know how it work magically!
I deleted my debug.keystore, build my project again and look for debug.keystore in default location ~/.android/debug.keystore, din't find debug.keystore.
Again build project and look for debug.keystore, no luck!
Then I open eclipse go to Windows -> Preferences,Select Android -> Build
See Default debug keystore: "Path".
Now again looked for debug.keystore in default location ~/.android/debug.keystore, found debug.keystore.
Tried so many times, it worked.
try this....it will generate the file debug.keystore to
C:/
for all versions of Windows
keytool -genkey -v -keystore C:/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 999999 -dname "CN=Android Debug,O=Android,C=US"
Try this for Generating PKCS keys.
keytool -importkeystore -srckeystore C:\Users\xxx\.android\debug.keystore -destkeystore C:\Users\xxx\.android\debug.keystore -deststoretype pkcs12
Note: RSA2048 is not a recommended industry standard and the above command can be used to migrate the existing debug.keystore in RSA2048 to PKCS format
The old debug.keystore which was in RSA2048 will be renamed to debug.keystore.old and saved automatically
To get the key you should first run the app on a device(real device or emulator). While debugging the file is automatically created.
debug.keystore automatically generate after the run of the app debugging
Related
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 am trying to create google login app in which i need Android Signing Certificate SHA-1.
At the starting there is .android folder in which contain two other files
but those are not debug.keystore so i read somewhere on stackoverflow they
said delete .android folder its will automatically created when rebuild the
project so i did it but it not created any .android folder or debug.keystore
i tried various command its giving only error given below
C:\Program Files\Java\jdk1.8.0_65\bin>keytool -list -v -keystore
"C:\Users\kulde\.android\debug.keystore" -alias androiddebugkey -storepass
android -keypass android
keytool error: java.lang.Exception: Keystore file does not exist:
C:\Users\kulde\.android\debug.keystore
java.lang.Exception: Keystore file does not exist:
C:\Users\kulde\.android\debug.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)
Instead of using debug.keystore which is less secure use your own created keyStore. Follow this to do the same
After you created your keystore, run the following command in terminal of Android studio.
keytool -list -v -keystore "path where .jks file is stored"
After this terminal will ask for password which you have created in above step.
Finally you will get your SHA-1 certificate.
Make sure you store your keystore safely. It will be used in future when you upload your App.
There is no debug.keystore in .android folder
The debug.keystore is created automatically on first build that uses it.
or
According to the documentation, performing a build in Eclipse or using ant debug should automatically generate ~/.android/debug.keystore.
But in case this doesn't work, you can create one manually by running:
keytool -genkey -v -keystore ~/.android/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"
Question about generating API Keys for Android in React Native.
I'm referencing these:
https://developers.google.com/maps/documentation/android-api/signup#release-cert
https://facebook.github.io/react-native/docs/signed-apk-android.html
https://github.com/lelandrichardson/react-native-maps/blob/master/docs/installation.md
What I'm wondering is, is how do I setup a debug API key for android if I'm NOT running on an emulator? I know I can use this command
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
if I want to create a debug.keystore that the emulator can look at, but how does this work for when I want to compile, build an apk, and run on my device? Do I have to set a pointer to it in gradle.properties? Does React Native know to look in that folder for the debug.keystore, and incorporate it into the apk? I'm not really sure how these things work.
cd android/app/
run:
keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
Well turns out i just needed to rerun react-native run-android, didn't get my latest change in.
From the looks of it, by default android's settings will look at ~/.android for the debug keystore.
This question already has answers here:
How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?
(47 answers)
Closed 7 years ago.
I get many tutorial for generate SHA-1 fingerprint (in general not just for maps) , but I want know whats the best way & what difference between this ways .
First way (keytool)
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Or by mention userprofile
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Second way (From Eclipse )
Window > Preferences > Android > Build
Thank you in advance & sorry for disturb
Try like this
first you can download and instal openssl and jdk file.
open command prompt and copy and paste jdk file path like this
C:\Program Files\Java\jdk1.6.0_37\bin>
Next Go to C:>User folder>Select (User name) folder> .android folder is there open that folder and copy the link
(or)
type the text line like this
keytool -list -v -keystore "C:\Users(user name).android\debug.keystore"
C:\Program Files\Java\jdk1.6.0_37\bin>keytool -list -v -keystore "C:\Users(user name).android\debug.keystore"
Enter keystore password: android
and click enter
list out the sha1 and md5 keys.
I am trying to find my keytool so that I can make keys to sign my app and to register for the google maps api
I'm beginning to think that I don't actually have it on my machine
If anyone could help point me in the right direction that would be great
To answer the original question, on my Mac, keytool is found at /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/keytool.
You can locate the Java home directory using the /usr/libexec/java_home command line tool on Mac OS X 10.5 or later.
If you are using Eclipse under Mac OS X you just need to
Select File -> Export -> select Android -> Export Android Application -> click next -> select your project -> click next -> here you just chose Create new keystore
The actual tool should be installed all ready, as to my knowledge it ships with the MAC. You then have to create the .keystore file http://www.androiddevelopment.org/tag/keytool/ shows how to do it
If you already have android studio installed, then keytool is located at
/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/bin/keytool
example to generate sha1 and sha256 using keytool
/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/bin/keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
I did the following and it worked for me:
/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/bin/keytool -genkey -v -keystore my-release-key.keystore -alias my_keystone -keyalg RSA -keysize 2048 -validity 10000
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA1 -keystore my-release-key.keystore app-release-unsigned.apk my_keystone
/Users/developer/Library/Android/sdk/build-tools/28.0.3/zipalign -v 4 app-release-unsigned.apk nameapp.apk
Simply use your keytool command in Android Studio Terminal for Mac with a random password
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
you will get -
ga0RGNYHvrrrrrrMMPWQWAPGJ8=