为Google Play构建Unity APK-找不到密钥库路径? [英] Building Unity APK for Google play- can't find keystore path?

查看:338
本文介绍了为Google Play构建Unity APK-找不到密钥库路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我将Android的Unity项目构建为"Google开发版本"并将其在Android Studio中打开后,我拼命尝试导出已签名的APK.

I am trying desperately to export my signed APK after building my Unity project for Android as a "Google development build" and opening it in Android Studio.

我查看了其他几个问题,并尝试遵循 https://developer.android.com/studio/publish/app-signing.html ,但创建我的密钥库时遇到问题.我已逐字阅读了本教程,但无法为梯形失真创建有效路径-

I have looked at several other questions and am trying to follow https://developer.android.com/studio/publish/app-signing.html but am having a problem creating my keystore. I have followed the tutorial verbatim but can't create a valid path for the keystone -

我不明白我需要做什么.我尝试过/home/users/keystores/android.jks我尝试过/home/users/keystores/myprojectname.jks并将其粘贴在桌面上.这些是我得到的错误-

I don't understand what I need to do. I have tried /home/users/keystores/android.jks I have tried /home/users/keystores/myprojectname.jks and just sticking it on my desktop. These are the errors Im getting-

我尝试定位android.jks,但无法使用finder找到任何内容.是因为我在Mac电脑上吗?我在这里做错了什么?如何生成密钥库以便发布?

I have tried locating android.jks but can't find anything using finder. Is it because I am on a mac? What am I doing wrong here? How can I generate my keystore so I can publish?

推荐答案

@skyguy您必须首先使用 keytool 创建密钥库.

@skyguy You have to create a keystore first using the keytool.

可以通过命令行访问keygen工具,该工具已经包含在JDK中.

The keygen tool can be accessed via command line and is already included in the JDK.

如果您向下滚动该链接我在上面的评论中发布了内容,您将看到以下示例-

If you scroll down that link I posted in my comment above, you will see the following example -

假设您想创建一个密钥库来管理您信任的实体的公钥/私钥对和证书.

Suppose you want to create a keystore for managing your public/private key pair and certificates from entities you trust.

生成密钥对您需要做的第一件事是创建一个密钥对. 密钥库并生成密钥对.您可以使用以下命令 以下:

Generating Your Key Pair The first thing you need to do is create a keystore and generate the key pair. You could use a command such as the following:

keytool -genkeypair -dname "cn=Mark Jones, ou=JavaSoft, o=Sun, c=US"
  -alias business -keypass kpi135 -keystore /working/mykeystore
  -storepass ab987c -validity 180 (Please note: This must be typed as a single line. Multiple lines are used in the examples just for legibility purposes.)

此命令在工作"目录中创建名为"mykeystore"的密钥库 目录(假设它尚不存在),并将其分配给 密码"ab987c".它为服务器生成一个公钥/私钥对. 其专有名称"具有通用名称"Mark Jones"的实体, "JavaSoft"的组织单位,"Sun"的组织和 两个字母的国家/地区代码"US".它使用默认的"DSA"键 生成算法来创建密钥,密钥长度均为1024位.

This command creates the keystore named "mykeystore" in the "working" directory (assuming it doesn't already exist), and assigns it the password "ab987c". It generates a public/private key pair for the entity whose "distinguished name" has a common name of "Mark Jones", organizational unit of "JavaSoft", organization of "Sun" and two-letter country code of "US". It uses the default "DSA" key generation algorithm to create the keys, both 1024 bits long.

它将创建一个自签名证书(使用默认的"SHA1withDSA" 签名算法),其中包括公钥和 专有名称信息.该证书的有效期为180 天,并且与密钥库条目中的私钥相关联 由别名业务"指代.私钥被分配了 密码"kpi135".

It creates a self-signed certificate (using the default "SHA1withDSA" signature algorithm) that includes the public key and the distinguished name information. This certificate will be valid for 180 days, and is associated with the private key in a keystore entry referred to by the alias "business". The private key is assigned the password "kpi135".

如果选项默认为 公认.实际上,不需要任何选择.默认是 用于具有默认值的未指定选项,并且您 提示您输入任何必需的值.因此,您可以简单地将 以下:

The command could be significantly shorter if option defaults were accepted. As a matter of fact, no options are required; defaults are used for unspecified options that have default values, and you are prompted for any required values. Thus, you could simply have the following:

keytool -genkeypair 

在这种情况下,将创建别名为"mykey"的密钥库条目,其中包含一个新生成的密钥对和一个证书 有效期为90天.此项放置在名为 主目录中的".keystore". (如果密钥库已创建, 还不存在.)系统将提示您输入 名称信息,密钥库密码和私钥密码. 其余示例假定您执行了-genkeypair命令 没有指定选项,并且您对提示进行了响应 值等于以上第一个-genkeypair命令中给出的值(a "kpi135"的私钥密码等)

In this case, a keystore entry with alias "mykey" is created, with a newly-generated key pair and a certificate that is valid for 90 days. This entry is placed in the keystore named ".keystore" in your home directory. (The keystore is created if it doesn't already exist.) You will be prompted for the distinguished name information, the keystore password, and the private key password. The rest of the examples assume you executed the -genkeypair command without options specified, and that you responded to the prompts with values equal to those given in the first -genkeypair command, above (a private key password of "kpi135", etc.)

创建密钥库后,您可以指向其位置并为apk签名.

Once you have created a keystore, you can point to its location and sign your apk.

这篇关于为Google Play构建Unity APK-找不到密钥库路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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