I can’t find the Android keytool

201,399

Solution 1

keytool comes with the Java SDK. You should find it in the directory that contains javac, etc.

Solution 2

Okay, so this post is from six months ago, but I thought I would add some info here for people who are confused about the whole API key/MD5 fingerprint business. It took me a while to figure out, so I assume others have had trouble with it too (unless I'm just that dull).

These directions are for Windows XP, but I imagine it is similar for other versions of Windows. It appears Mac and Linux users have an easier time with this so I won't address them.

So in order to use mapviews in your Android apps, Google wants to check in with them so you can sign off on an Android Maps APIs Terms Of Service agreement. I think they don't want you to make any turn-by-turn GPS apps to compete with theirs or something. I didn't really read it. Oops.

So go to http://code.google.com/android/maps-api-signup.html and check it out. They want you to check the "I have read and agree with the terms and conditions" box and enter your certificate's MD5 fingerprint. Wtf is that, you might say. I don't know, but just do what I say and your Android app doesn't get hurt.

Go to Start>Run and type cmd to open up a command prompt. You need to navigate to the directory with the keytool.exe file, which might be in a slightly different place depending on which version JDK you have installed. Mine is in C:\Program Files\Java\jdk1.6.0_21\bin but try browsing to the Java folder and see what version you have and change the path accordingly.

After navigating to C:\Program Files\Java\<"your JDK version here">\bin in the command prompt, type

keytool -list -keystore "C:/Documents and Settings/<"your user name here">/.android/debug.keystore"

with the quotes. Of course <"your user name here"> would be your own Windows username.

(If you are having trouble finding this path and you are using Eclipse, you can check Window>preferences>Android>Build and check out the "Default Debug keystore")

Press enter and it will prompt you for a password. Just press enter. And voila, at the bottom is your MD5 fingerprint. Type your fingerprint into the text box at the Android Maps API Signup page and hit Generate API Key.

And there's your key in all its glory, with a handy sample xml layout with your key entered for you to copy and paste.

Solution 3

Ok I did this in Windows 7 32-bit system.

step 1: go to - C:\Program Files\Java\jdk1.6.0_26\bin - and run jarsigner.exe first ( double click)

step2: locate debug.keystore, in my case it was - C:\Users\MyPcName\.android

step3: open command prompt and go to dir - C:\Program Files\Java\jdk1.6.0_26\bin and give the following command: keytool -list -keystore "C:\Users\MyPcName\.android\debug.keystore"

step4: it will ask for Keystore password now. ( which I am figuring out... :-? )

update: OK in my case password was ´ android ´. - (I am using Eclipse for android, so I found it here) Follow the steps in eclipse: Windows>preferences>android>build>..
( Look in `default Debug Keystore´ field.)



Command to change the keystore password (look here): Keystore change passwords



Solution 4

The 4-Step Answer above worked for me, but it returns the SH1-key... but Google asks for the MD5-key to generate your API key.

One needs simply to add a '-v' in the command in step 3. -like so:

Updated 4-Step Answer

Ok I did this in Windows 7 32-bit system.

step 1: go to - C:\Program Files\Java\jdk1.7.0\bin - and run jarsigner.exe first ( double click)

step2: locate debug.keystore (in Eclipse: Windows/Preferences/Android/build..), in my case it was - C:\Users\MyPcName.android

step3: open command prompt and go to dir - C:\Program Files\Java\jdk1.7.0\bin and give the following command: keytool -v -list -keystore "C:\Users\MyPcName.android\debug.keystore"

step4: it will ask for Keystore password now. The default is 'android'

Solution 5

I never installed Java, but when you install Android Studio it has its own version within the Android directory. Here is where mine is located. Your path may be similar. After that you can either put the keytool into your path, or just run it from that directory.

C:\Program Files\Android\Android Studio\jre\bin
Share:
201,399

Related videos on Youtube

Tim
Author by

Tim

Updated on July 07, 2020

Comments

  • Tim
    Tim almost 4 years

    I am trying to follow the Android mapping tutorial and got to this part where I had to get an API key.

    I have found my debug.keystore but there does not appear to be a keytool application in the directory:

    C:\Documents and Settings\tward\\.android>ls
    adb_usb.ini      avd       debug.keystore  repositories.cfg androidtool.cfg  ddms.cfg  default.keyset
    

    There is also no keytool in this directory:

    C:\Android\android-sdk-windows\tools>ls
    AdbWinApi.dll     apkbuilder.bat       etc1tool.exe         mksdcard.exe
    AdbWinUsbApi.dll  ddms.bat             fastboot.exe         source.properties
    Jet               dmtracedump.exe      hierarchyviewer.bat  sqlite3.exe
    NOTICE.txt        draw9patch.bat       hprof-conv.exe       traceview.bat
    adb.exe           emulator.exe         layoutopt.bat        zipalign.exe
    android.bat       emulator_NOTICE.txt  lib
    

    I am using Eclipse as my editor and believe that I have downloaded all the latest SDK.

    What am I doing wrong?

    • Tim
      Tim about 14 years
      Great. Posted my second ever question and I get a "Tumbleweed" for my first badge!!! Please mock me gently :-)
    • Pankaj Nimgade
      Pankaj Nimgade over 8 years
      awesome, did you find a way to get release SHA1 on windows
  • Tim
    Tim about 14 years
    Got it: C:\Program Files\Java\jdk1.6.0_14\bin Thanks
  • zabawaba99
    zabawaba99 over 11 years
    You saved me a headache or two
  • Ian R. O'Brien
    Ian R. O'Brien over 11 years
    This should probably be a comment and not an answer.
  • Ryan R
    Ryan R over 11 years
    Shouldn't those be backslashes, instead of forward slashes, on Windows?
  • Ryan R
    Ryan R over 11 years
    FYI, if you use jdk1.7 add the modifier -v
  • Nick.T
    Nick.T over 11 years
    can even find it in the JRE... Thanks
  • basickarl
    basickarl over 10 years
    More people should explain like you!
  • Joel Balmer
    Joel Balmer over 10 years
    I agree should be a comment, although that's bad luck, you don't have enough rep to comment!
  • Iyas
    Iyas about 10 years
    perhaps for use to discover the SHA1 fingerprint?
  • Nicolai Lissau
    Nicolai Lissau over 9 years
    A useful trick is to save the output to a file, so you can grab the key. Just add this in the end: > somefilename.txt
  • Pankaj Nimgade
    Pankaj Nimgade over 8 years
    @malfunction, is there a way to get SHA1 for release build on windows
  • Jean-François
    Jean-François about 8 years
    In C:\Program Files\Java\jdk1.7.0_79\bin
  • Tim Krins
    Tim Krins over 7 years
    Mine was in C:\Program Files\Android\Android Studio\jre\bin (Using Studio, not Eclipse)
  • Shaurya Uppal
    Shaurya Uppal over 6 years
    those not having JDK install from here oracle.com/technetwork/java/javase/downloads/…
  • asitis
    asitis over 2 years
    Aiwaa!! this helped ! thanks