76

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?

2
  • .android is a hidden folder; do you see it on her computer? or is it missing also?
    – Adinia
    Dec 20, 2011 at 14:15
  • No, it's there. It seems that instead of debug.keystore, there is a 'debug'
    – Cody
    Dec 20, 2011 at 14:18

11 Answers 11

177

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"
5
  • 7
    For windows 64 bit users: keytool -genkey -v -keystore "C:\Program Files (x86)\Android\android-sdk\.android\debug.keystore" -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US" Oct 8, 2013 at 11:34
  • That would be for windows 32 bit wouldn't it? For anyone using Xamarin mine was in C:\Users\<UserName>\AppData\Local\Xamarin
    – Ernesto
    Aug 25, 2016 at 16:23
  • 4
    This specific keytool command didn't work for me, but it helped me find this question, stackoverflow.com/questions/36554463/… which resolved it
    – GregHNZ
    Oct 3, 2017 at 20:49
  • I must add that for Ws 64bits you can find keytool in C:\Program Files\Java\jdk1.8.0_25\bin (I suppose that for Ws 32bits is the same path)
    – Max Collao
    Aug 31, 2018 at 1:48
  • Now it also requires the keyalg option to be specified. The below answer by @Aravin works well Nov 28, 2020 at 17:11
22

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"

1
  • 2
    The accepted answer is missing -keyalg parameter which keytool was complaining about. This one worked for me.
    – kub1x
    Aug 26, 2020 at 10:34
20

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.

4
4

The debug.keystore is created automatically on first build that uses it.

2
  • 7
    No sir, it isn't. Perform the following test: delete debug.keystore from your .android folder. In eclipse do project > clean, and launch your app. The debug.keystore is not generated. Sep 7, 2012 at 19:50
  • It is in Android Studio 0.8.0.
    – Rob Levine
    Aug 11, 2014 at 11:33
2

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"
1

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 (").

1

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.

0

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

0

To get the key you should first run the app on a device(real device or emulator). While debugging the file is automatically created.

0

debug.keystore automatically generate after the run of the app debugging

0

If you are looking for the debug.keystore file and are using react native for development. I found it inside of the android/app folder. No need to run it on Android Studio

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.