特别提醒 :配置好下面提示的路径以后,可以直接在Android Studio的Terminal中获取key hash,因为Android SDK本身会集成key tools工具。
生成开发秘钥散列(Key Hashes)命令
windows
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl
base64
注:使用自己.keystore的绝对路径代替%HOMEPATH%.android\debug.keystore,
例如:keytool -exportcert -alias androiddebugkey -keystore "D:\......\example.keystore" | openssl sha1 -binary | openssl base64
iOS
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
生成发布秘钥散列(Key Hashes)命令
keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64
生成MD5、SHA1、SHA256 命令
windows
keytool.exe -list -v -keystore "%LocalAppData%\Xamarin\Mono for Android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
iOS
keytool -list -v -keystore ~/.local/share/Xamarin/Mono\ for\ Android/debug.keystore -alias androiddebugkey -storepass android -keypass android
参考文档 : Finding your Keystore's MD5 or SHA1 Signature