我试图在命令提示符中执行以下命令。
keytool -exportcert -alias androiddebugkey -keystore "<path-to-users-directory>\.android\debug.keystore" | openssl sha1 -binary | openssl base64
但命令提示符窗口报告:
'openssl' is not recognized as internal or external command.
我可以在命令提示符窗口中执行此命令吗?
从以下链接安装Windows的openssl。
https://code.google.com/p/openssl-for-windows/downloads/detail?name=openssl-0.9.8k_WIN32.zip
你看到的错误意味着你的%PATH%
(外部命令)中没有这样的程序,它也不是内置的shell命令(内部命令)。
在您的计算机上安装OpenSSL。您还需要检查其安装位置是否在您的%PATH%
中。默认情况下,它可能不会。例如,假设OpenSSL安装在c:\OpenSSL-Win32
。 openssl
二进制文件可能位于c:\OpenSSL-Win32\bin\openssl.exe
。所以你的路径需要包括c:\OpenSSL-Win32\bin
。
有时,OpenSSL无法在Windows上找到其配置文件。为此,请参阅OpenSSL and error in reading openssl.conf file。
另一种选择是使用命令中的完整路径:
keytool -exportcert -alias androiddebugkey -keystore "<path-to-users-directory>\.android\debug.keystore" | ^
c:\OpenSSL-Win32\bin\openssl.exe sha1 -binary | c:\OpenSSL-Win32\bin\openssl.exe base64
但是,这仍然会受到OpenSSL and error in reading openssl.conf file详细介绍的OpenSSL配置文件问题的影响。
在Windows计算机上安装openssl。