I can’t find the Android keytool

2020-01-24 10:22发布

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?

10条回答
戒情不戒烟
2楼-- · 2020-01-24 10:55

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
查看更多
地球回转人心会变
3楼-- · 2020-01-24 10:56

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'

查看更多
劫难
4楼-- · 2020-01-24 11:00

No need to use the command line.

If you FILE-> "Export Android Application" in the ADK then it will allow you to create a key and then produce your .apk file.

查看更多
迷人小祖宗
5楼-- · 2020-01-24 11:06

In fact, eclipse export will call

java -jar android-sdk-windows\tools\lib\sdklib.jar com.android.sdklib.build.ApkBuilderMain

and then call com.android.sdklib.internal.build.SignedJarBuilder.

查看更多
登录 后发表回答