33

I'm getting this error.

C:\Program Files\Java\jre7\bin>keytool -list -v -keystore "C:\Users\Suresh\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

keytool error: java.lang.Exception: Keystore file does not exist: C:\Users\Suresh\.android\debug.keystore

java.lang.Exception: Keystore file does not exist: C:\Users\Suresh\.android\debug.keystore

at sun.security.tools.KeyTool.doCommands(Unknown Source)
at sun.security.tools.KeyTool.run(Unknown Source)
at sun.security.tools.KeyTool.main(Unknown Source)

C:\Program Files\Java\jre7\bin>

enter image description here

hexacyanide
  • 88,222
  • 31
  • 159
  • 162
Jahir
  • 552
  • 4
  • 9
  • 17

6 Answers6

28

You must be providing the wrong path to the debug.keystore file.

Follow these steps to get the correct path and complete your command:

  1. In eclipse, click the Window menu -> Preferences -> Expand Android -> Build
  2. In the right panel, look for: Default debug keystore:
  3. Select the entire box next to the label specified in Step 2

And finally, use the path you just copied from Step 3 to construct your command:

For example, in my case, it would be:

C:\Program Files\Java\jre7\bin>keytool -list -v -keystore "C:\Users\Siddharth Lele.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

UPDATED:

If you had already followed the steps mentioned above, the only other solution is to delete the debug.keystore and let Eclipse recreate it for you.

Step 1: Go to the path where your keystore is stored. In your case, C:\Users\Suresh\.android\debug.keystore

Step 2: Close and restart Eclipse.

Step 3 (Optional): You may need to clean your project before the debug.keystore is created again.

Source: http://www.coderanch.com/t/440920/Security/KeyTool-genkeypair-exception-Keystore-file

You can refer to this for the part about deleting your debug.keystore file: "Debug certificate expired" error in Eclipse Android plugins

Community
  • 1
  • 1
Siddharth Lele
  • 27,623
  • 15
  • 98
  • 151
27

Use This for MAC users

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
hash
  • 5,336
  • 7
  • 36
  • 59
4

For Mac Users: The debug.keystore file exists in ~/.android directory. Sometimes, due to the relative path, the above mentioned error keeps on popping up.

Sahil Babbar
  • 579
  • 1
  • 7
  • 21
  • I have the latest version of Android Studio (1.5.1) and my debug.keystore isn't there. I can't find it. Any pointers? I'm using OSX El Capitan. – Rameez Hussain Jan 13 '16 at 22:46
  • Same problem with me, Have you solved it yet? @Rameez Hussain – nadeem gc Feb 11 '16 at 09:51
  • This might be due to [SIP](https://en.wikipedia.org/wiki/System_Integrity_Protection) introduced in OSX El Capitan and due to this, community support becomes weak as new concepts are introduced in El Capitan. You'll have to personally solve it, and community can only provide pointers for some time. – Sahil Babbar Feb 14 '16 at 14:17
2

For Mac/Linux debug keystore, the Android docs have:

keytool -exportcert -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore

But there is something that may not be obvious: If you put the backslash, make sure to do a shift + return in terminal after the backslash so that the second that starts with -alias is on a new line. Simply pasting as-is will not work.

Your terminal (if successful) will look something like this:

$ keytool -exportcert -list -v \
→ -alias androiddebugkey -keystore ~/.android/debug.keystore
Enter keystore password: 

The default debug password is: android

Side note: In Android Studio you can manage signing in:

File > Project Structure > Modules - (Your App) > Signing

Tomanow
  • 7,247
  • 3
  • 24
  • 52
1

go to ~/.android if there is no debug.keystore copy it from your project and paste it here then run command again.

Neo Murphy
  • 67
  • 1
  • 9
0

In macOS, open the Terminal and type below command

~/.android

It will navigate to the folder that containing Keystore file (You can confirm it with 'ls' command)

In my case, there is a file named 'debug.keystore'. Then type below command in the terminal from the ~/.android directory.

keytool -list -v -keystore debug.keystore

You will get the expected output.

Bibin Jaimon
  • 534
  • 1
  • 6
  • 15