如何在 Xcode 中安装证书(准备应用商店提交)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4156128/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 03:35:38  来源:igfitidea点击:

How to install a certificate in Xcode (preparing for app store submission)

iphonexcodecertificateapp-storesubmission

提问by testing

I wan't to select my distribution profile in Code Signing Identityin the build tab of targets. But all my certificates (developer, ad hoc, ...) are grayed out. So it seems that the new profile XXX.mobileprovision is not installed. The guidelines say

我不想Code Signing Identity在目标的构建选项卡中选择我的分发配置文件。但是我的所有证书(开发人员、临时证书等)都变灰了。所以似乎没有安装新的配置文件XXX.mobileprovision。指南说

Download the distribution profile and install it in the Xcode Organizer. Drag the .mobileprovision file to the Provisioning Profiles list under IPHONE DEVELOPMENT in the Organizer.

下载分发配置文件并将其安装在 Xcode Organizer 中。将 .mobileprovision 文件拖到管理器中 IPHONE DEVELOPMENT 下的 Provisioning Profiles 列表中。

But nothing happens. No green plus icon appears.

但什么也没有发生。不会出现绿色加号图标。

If I double click the profile Xcode shows me an empty file ...

如果我双击配置文件 Xcode 会显示一个空文件...

Can someone help me out?

有人可以帮我吗?

Additional information:

附加信息:

First I created an Ad-Hoc profile (with another bundle identifier), which works (now). The certificate owner and the user name on the Mac are not the same (but the private key was created under this username). In Xcode I can only see the old developer certificate (from the Ad-Hoc profile).

首先,我创建了一个 Ad-Hoc 配置文件(带有另一个包标识符),它可以工作(现在)。证书所有者和 Mac 上的用户名不一样(但私钥是在这个用户名下创建的)。在 Xcode 中,我只能看到旧的开发人员证书(来自 Ad-Hoc 配置文件)。

I set the app to Release.

我将应用程序设置为Release.

采纳答案by testing

Under

在下面

Provisioning -> Distribution -> Distribution Provisioning Profiles

供应 -> 分发 -> 分发供应配置文件

I downloaded the desired certificate again and installed it. Now I don't see an empty file in Xcode. The build also works now (no code sign error).

我再次下载了所需的证书并安装了它。现在我在 Xcode 中没有看到空文件。构建现在也可以工作(没有代码签名错误)。

What I also did: I downloaded the WWDR and installed it, but I don't know if that was the reason (because I think it's always the same)

我还做了什么:我下载了 WWDR 并安装了它,但我不知道是不是这个原因(因为我认为它总是一样的)

回答by James Toomey

In Xcode 5 this has been moved to:

在 Xcode 5 中,这已移至:

Xcode>Preferences>Accounts>View Details button>

Xcode>首选项>帐户>查看详细信息按钮>

回答by Chris

You can update your provisioning certificates in XCode at:

您可以在 XCode 中更新您的配置证书:

Organizer -> Devices -> LIBRARY -> Provisioning Profiles

There is a refresh button :) So if you have created the certificate manually in iTunes connect, then you need to press this button or download the certificate manually.

有一个刷新按钮 :) 因此,如果您在 iTunes 连接中手动创建了证书,那么您需要按此按钮或手动下载证书。

回答by Darius Miliauskas

These instructions are for XCode 6.4 (since I couldn't find the update for the recent versions even thiswas a bit outdated)

这些说明适用于 XCode 6.4(因为我找不到最近版本的更新,即使有点过时)

a) Part on the developers' website:

a) 开发者网站上的部分:

Sign in into: https://developer.apple.com/

登录:https: //developer.apple.com/

Member Center

会员中心

Certificates, Identifiers & Profiles

证书、标识符和配置文件

Certificates>All

证书>全部

Click "+" to add, and then follow the instructions. You will need to open "Keychain Access.app", there under "Keychain Access" menu > "Certificate Assistant>", choose "Request a Certificate From a Certificate Authority" etc.

单击“+”进行添加,然后按照说明进行操作。您需要打开“Keychain Access.app”,在“Keychain Access”菜单>“Certificate Assistant>”下,选择“Request a Certificate From a Certificate Authority”等。

b) XCode part:

b) XCode 部分:

After all, you need to go to XCode, and open XCode>Preferences..., choose your Apple ID > View Details... > click that rounded arrow to update as well as "+" to check for iOS Distribution or iOS Developer Signing Identities.

毕竟,您需要转到 XCode,然后打开 XCode>Preferences...,选择您的 Apple ID > 查看详细信息...> 单击圆形箭头进行更新以及“+”检查 iOS Distribution 或 iOS Developer签署身份。