如何复制debug.keystore文件? [英] How to copy the debug.keystore file?

查看:76
本文介绍了如何复制debug.keystore文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在> Google Google Maps在我以外的地方无法使用时遇到了同样的问题计算机,并且在解决方案中,确保团队中的每个人都拥有相同的.keystore文件可以解决该问题.但是,.keystore文件是隐藏的,我想它也已经以某种方式加密,您不能只使用cat命令来查看它.

I have the same problem with Android Google Maps not working outside my computer, and in the solution, it looks like making sure everyone in my team have the same .keystore file will solve the problem. However, .keystore file is hidden, I guess it's also encrypted in some way that you can't just view it using cat command.

我正在与队友一起进行一个android项目,我负责地图部分,但是即使我们拥有完全相同的代码(使用git共享),也没有人可以看到地图.

I am working with my teammates on a android project and I'm in charge of the map part, but no one else can see the map even if we have the exactly same codes(shared using git).

所以有人可以告诉我如何将文件复制到其他人吗(这样做安全吗?)?

So could anyone please tell me how to copy the file to others (and is it safe to do so)?

还是有其他方法可以做到这一点?

Or is there any other ways to do this?

我使用Mac,我的队友使用Windows和Mac.

I use a mac, the I have teammates using windows and mac.

推荐答案

选项a)

您可以使团队中的每个人都使用相同的签名密钥进行调试.

Option a)

You can make everyone on your team use the same signing key for debug builds.

我喜欢这种解决方案,因为在测试时,您可以轻松地从同事那里更新已安装的应用程序(因为签名匹配).

I like this solution because when testing you can easily update already installed apps from your colleagues (because the signatures match).

将其中一个调试密钥库复制到项目根目录中.调试密钥库通常位于〜/.android/debug.keystore 中.让我们将副本命名为 prepro.keystore .

Copy one of your debug keystores in your project root directory. Debug keystore is typically located in ~/.android/debug.keystore. Let's name the copy prepro.keystore.

在您的 app模块 build.gradle中,使用第1步中的密钥库创建一个新的签名配置.

In your app module build.gradle create a new signing config that's using the keystore from step 1.

android {
    signingConfigs {
        prepro {
            storeFile rootProject.file("prepro.keystore")
            storePassword "android"
            keyAlias "androiddebugkey"
            keyPassword "android"
        }
    }
}

记下所有调试密钥库的密码和密钥别名.

Note the passwords and key alias for all debug keystores.

使所有调试版本都使用此新的签名配置.

Make all your debug builds use this new signing config.

android {
    buildTypes {
        debug {
            signingConfig signingConfigs.prepro
        }
    }
}

注释

除了 debug release 之外,您都可以为新的签名配置命名.

Notes

You can name your new signing config anything except debug and release.

这样做安全吗

只要是用于开发的密钥,就可以在Git中插入密钥.

Putting a key in Git is OK as long as it's a key intended for development.

将同事的调试键签名添加到项目Google控制台.然后由他们构建的应用程序将能够使用Google API,例如Maps.

Add your colleagues' debug key signatures to the project Google console. Then apps built by them will be able to use Google APIs such as Maps.

此处的更多信息: https://developers.google.com/maps/documentation/android-api/signup#getting-the-certificate-information-yourself

我猜想它也以某种方式加密,您不能只使用cat命令来查看它.

I guess it's also encrypted in some way that you can't just view it using cat command.

正确,请参见上面的链接.

Correct, see the link above.

这篇关于如何复制debug.keystore文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆