debug.keystore在android中有什么用?

What is the use of debug.keystore in android?

我有一个小的澄清。我有以下问题,

1.Whetherdebug.keystore是用来在每次正常构建项目时生成apk吗?

2.I 已完成解压生成的 apk 文件。我来看看 META-INF 文件夹中有可用的证书。这些证书是用debug.keystore生成的,用来识别系统标识吗?。因为,两个 SHA1 哈希值在解压缩的 apk 的 debug.keystore 和 cert.RSA 中是相同的。

请解开这个疑惑。

提前致谢..

您要在设备上安装的每个 apk 都需要签名。调试密钥只是您的构建工具在您第一次使用它时随机生成的证书,它会在您构建调试版本时自动用于签名。在其他方面,它与您生成的用于在 Play 商店发布的证书基本上没有区别(当然,忽略了它使用错误的个人信息和固定密码的事实)

所以再说一遍:如果你构建为调试,则使用调试密钥库,否则如果你想创建一个版本,你必须创建你自己的密钥库并将构建脚本指向它.

有关 google 文档的更多信息:http://developer.android.com/tools/publishing/app-signing.html

In debug mode, you sign your app with a debug certificate generated by the Android SDK tools. This certificate has a private key with a known password, so you can run and debug your app without typing the password every time you make a change to your project.

Android Studio signs your app in debug mode automatically when you run or debug your project from the IDE.

You can run and debug an app signed in debug mode on the emulator and on devices connected to your development machine through USB, but you cannot distribute an app signed in debug mode.

By default, the debug configuration uses a debug keystore, with a known password and a default key with a known password. The debug keystore is located in $HOME/.android/debug.keystore, and is created if not present. The debug build type is set to use this debug SigningConfig automatically.

作为附加的专业提示:如果您在一个团队中使用不同的共享测试设备进行开发,那么如果你们都共享同一个调试密钥库,则可以节省很多时间,否则您从另一个开发人员那里获取测试设备时总是必须卸载调试应用程序

您无法在没有相同密钥库值的情况下更新应用程序,否则应用程序会显示不同的签名。 例如,几天后您从 Playstore 安装了一个应用程序,如果应用程序有更新,那么您将只能在其签名和新应用程序签名相同的情况下更新以前的应用程序。此签名在 debug.keystore

中定义