我正在这里阅读Facebook开发者的开发指南
它说,我必须使用keytool导出签名为我的应用程序,如:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
我不知道如何找到关键工具,以运行它。我试图打开Windows命令提示符并粘贴上述命令,但它不起作用。
我正在这里阅读Facebook开发者的开发指南
它说,我必须使用keytool导出签名为我的应用程序,如:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
我不知道如何找到关键工具,以运行它。我试图打开Windows命令提示符并粘贴上述命令,但它不起作用。
当前回答
在cmd窗口(需要以管理员身份运行),
cd %JAVA_HOME%
只有在设置了系统环境变量JAVA_HOME后才有效。要为路径设置系统变量,可以这样做
setx %JAVA_HOME% C:\Java\jdk1.8.0_121\
然后你就可以打字了
cd c:\Java\jdk1.8.0_121\bin
or
cd %JAVA_HOME%\bin
然后,执行JAVA jdk提供的任何命令,例如
keytool -genkey -v -keystore myapp.keystore -alias myapp
你只需要按回车键后回答问题(相当于在cmd行上输入值)!密钥将被生成
其他回答
在cmd窗口(需要以管理员身份运行),
cd %JAVA_HOME%
只有在设置了系统环境变量JAVA_HOME后才有效。要为路径设置系统变量,可以这样做
setx %JAVA_HOME% C:\Java\jdk1.8.0_121\
然后你就可以打字了
cd c:\Java\jdk1.8.0_121\bin
or
cd %JAVA_HOME%\bin
然后,执行JAVA jdk提供的任何命令,例如
keytool -genkey -v -keystore myapp.keystore -alias myapp
你只需要按回车键后回答问题(相当于在cmd行上输入值)!密钥将被生成
KEYTOOL在JAVAC SDK中,所以你必须在包含jns JAVAC的目录中找到它
假设您已经在系统中安装了Java,最好是JDK(因为您在问题中提到了它,所以适用于Windows),您应该在安装的bin文件夹中有keytool实用程序。
如果是这种情况,接下来要做的就是将该bin文件夹添加到Windows安装的PATH环境变量中。
下次你将打开一个Windows shell,你将键入keytool,你将能够运行实际的实用程序。
Few observations while I was getting the same problem (Windows). 1. Shell pipe is important. 2. If you are using OpenSSL or Cygwin, definitely you have to install it. 3. keytool comes with JDK so either you have to point to it in the command or you have cd to the JDK/bin folder (where the exe resides) 4. The debug keystore is typically located at ~/.android/debug.keystore 5. password is "android" whether you -keypass it or type it when prompted. 6. For the alias name, you can open (DO NOT SAVE, just open and close) the keystore file with any editor and read it. 7. MOST IMPORTANT - There is a difference is specifying the keystore path within quotes and without. I got it working by using the keystore path within the double quotes. As remix090378 said and as per the instruction, this command indeed worked - cd C:\Program Files\Java\jdk1.7.0_09\bin
keytool -exportcert -alias androiddebugkey -keystore "C:\Users\userName.android\debug. keystore "密钥存储库" -list -v
Android:在Android中执行keytool命令的位置
如果在classpath变量中设置了JRE,则可以在dos命令提示符下运行Keytool命令。
例如,如果您想获取android SDK调试证书的MD5指纹,
只需运行以下命令…
C:\Documents and Settings\user\.android> keytool -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android
C:\Documents and Settings\user\.Android >是包含调试的路径。必须经过认证的密钥存储库。
详情请访问http://code.google.com/android/add-ons/google-apis/mapkey.html#getdebugfingerprint