ios 没有 XC 的 XCode 6 和 Ad-Hoc 分发:配置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25999847/
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-08-31 02:43:40  来源:igfitidea点击:

XCode 6 and Ad-Hoc distribution without XC: provisioning

iosxcodecertificateprovisioningad-hoc-distribution

提问by Roval

Yesterday I've downloaded Xcode6 and now I have got a problem I can't solve. In my member center I've got valid certificate and ad-hoc provisioning (distribution). Till yesterday, in Xcode5 if I wanted to add my .ipa to TestFlight I was using Archive and selecting my valid ad-hoc profile. I wasn't even logged in in my developer account in Xcode.

昨天我下载了Xcode6,现在我遇到了一个无法解决的问题。在我的会员中心,我有有效的证书和临时配置(分发)。直到昨天,在Xcode5 中,如果我想将我的 .ipa 添加到 TestFlight,我正在使用存档并选择我的有效临时配置文件。我什至没有在 Xcode 中登录我的开发者帐户。

Now - in Xcode6 - nothing is working at all. Ok, I've logged in preferences, Xcodedownloaded all my provisionings on Mac, but whenever I choose Export it says that I don't have matching provisioning profile and it's creating new provisioning profile with XC: prefix - which I don't want to use, because it contains all devices I have in member center - even those I don't want to include in my app!

现在 - 在Xcode6 - 没有任何工作可言。好的,我已经登录首选项, Xcode在 Mac 上下载了我的所有配置,但是每当我选择“导出”时,它都会说我没有匹配的配置文件,并且它正在创建带有 XC: 前缀的新配置文件 - 我不想这样做使用,因为它包含我在会员中心拥有的所有设备 - 甚至那些我不想包含在我的应用程序中的设备!

I was trying everything from this threads:

我正在尝试这个线程中的所有内容:

Xcode 6 - How to pick signing certificate/provisioning profile for Ad-Hoc distribution?

Xcode 6 - 如何为 Ad-Hoc 分发选择签名证书/配置文件?

Xcode 6 GM creating archive

Xcode 6 GM 创建存档

but nothing is working for me. Maybe I don't understand correctly how it works and there is a trick I have to do but I would like to use provisioning profile defined by me. I was trying to create new provisioning profile, rename the old one, remove all from Mac, drag provisioing profile from desktop to Xcode icon, select correct Provisioning Profile in Build Setting all over again but I'm stuck.

但没有什么对我有用。也许我没有正确理解它是如何工作的,我必须做一个技巧,但我想使用我定义的配置文件。我试图创建新的配置文件,重命名旧的,从 Mac 中删除所有内容,将配置文件从桌面拖到 Xcode 图标,再次在构建设置中选择正确的配置文件,但我卡住了。

Screenshots here:

截图在这里:

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

My Ad-hoc profile is distribution profile.

我的临时配置文件是分发配置文件。

采纳答案by Adam Freeman

I have a workaround for this that works for me.

我有一个对我有用的解决方法。

I have both Xcode 6 and Xcode 5.1.1 installed, Xcode 6 is in Applications and Xcode 5.1.1 is in another directory. When I want to do a build I use Xcode 6 to create the Archive. But you can also see the created Archive in Xcode 5.1.1 so I use Xcode 5.1.1 to distribute the Ad Hoc .ipa using the provisioning profile that I want to use. So build using Xcode 6 but distribute using Xcode 5.1.1. It works for me.

我安装了 Xcode 6 和 Xcode 5.1.1,Xcode 6 在 Applications 中,Xcode 5.1.1 在另一个目录中。当我想做一个构建时,我使用 Xcode 6 来创建存档。但是您也可以在 Xcode 5.1.1 中看到创建的存档,因此我使用 Xcode 5.1.1 使用我想要使用的配置文件分发 Ad Hoc .ipa。所以使用 Xcode 6 构建但使用 Xcode 5.1.1 分发。这个对我有用。

回答by clarkcox3

There is no way to get Xcode 6.x to use an ad-hoc profile that doesn't contain all of the devices on your team; this is by design.

没有办法让 Xcode 6.x 使用不包含团队中所有设备的临时配置文件;这是设计使然。

回答by Chris Murphy

Xcode6 will now always create a new AdHoc provisioning profile prefixed with 'XC' when you export an archive for testing (e.g. Hockey App). In order to do this you must always have the latest App Store Distribution certificate and private key in your keychain.

当您导出用于测试的存档(例如 Hockey App)时,Xcode6 现在将始终创建一个以“XC”为前缀的新 AdHoc 配置文件。为此,您的钥匙串中必须始终拥有最新的 App Store 分发证书和私钥。

NOTE: You do not have to have this latest distribution certificate selected in your provisioning profile you built the archive with. Also keep in mind you do not need to have an AdHoc provisioning profile to export an AdHoc ipa.

注意:您不必在用于构建存档的配置文件中选择此最新分发证书。另请记住,您不需要具有 AdHoc 配置文件来导出 AdHoc ipa。

When you export the first time you will probably receive an error saying that you do not have an AdHoc provisioning profile with the following devices/people in it. Just hit 'Try Again' and it will work.

当您第一次导出时,您可能会收到一条错误消息,指出您没有包含以下设备/人员的 AdHoc 配置文件。只需点击“再试一次”,它就会起作用。

Something else to keep in mind is that when exporting an ipa you are forced to test push notifications through their distribution/production servers as it is using the new self generated 'Distribution XC: AdHoc' provisioning profile.

要记住的另一件事是,在导出 ipa 时,您必须通过其分发/生产服务器测试推送通知,因为它使用新的自行生成的“分发 XC:AdHoc”配置文件。

If you are using Urban Airship like we are you can no longer use development keys for testing. If you look under 'Entitlements' once you get through the steps to export it will show you that 'aps-environment' is set to 'production'. If anyone finds an alternate solution for this let me know.

如果您像我们一样使用 Urban Airship,则不能再使用开发密钥进行测试。如果您在完成导出步骤后查看“权利”,它将显示“aps-environment”设置为“生产”。如果有人为此找到了替代解决方案,请告诉我。

回答by grgmo

I was facing similar issue with my distribution license, and the problem was there was "XC" provisioning profile which had the exact same bundle id.

我的分发许可证遇到了类似的问题,问题是“XC”配置文件具有完全相同的捆绑包 ID。

My solution to his was to delete this XC: provisioning profile both from Apple Developer Portal and Xcode -> Preferences -> Apple ID -> View Details -> XC: provisioning profile -> right click Go To Finder -> delete

我对他的解决方案是从 Apple Developer Portal 和 Xcode 中删除这个 XC:provisioning profile -> Preferences -> Apple ID -> View Details -> XC: provisioning profile -> 右键单击​​ Go To Finder -> delete

Hope this helps,

希望这可以帮助,

回答by Oran Dennison

I encountered the same issue. On one of the StackOverflow threads you linked to, a solutionwas recently added that worked for me.

我遇到了同样的问题。在您链接到的 StackOverflow 线程之一上,最近添加了一个对我有用的解决方案

After you have created the archive, you can export it with a specific provisioning profile from the command line:

创建存档后,您可以使用特定的配置文件从命令行导出它:

xcodebuild -exportArchive -archivePath "~/Library/Developer/Xcode/Archives/{some-date}/{appname date, time.xcarchive" -exportPath {appname} -exportFormat ipa -exportProvisioningProfile "{provisioning profile name}"

xcodebuild -exportArchive -archivePath "~/Library/Developer/Xcode/Archives/{some-date}/{appname date, time.xcarchive" -exportPath {appname} -exportFormat ipa -exportProvisioningProfile "{provisioning profile name}"

Note that the provisioning profile name is just the name, without any path or file extension.

请注意,配置文件名称只是名称,没有任何路径或文件扩展名。

回答by valheru

I ran into this today as well.

我今天也遇到了这个。

I ended up removing the XC profile from the developer portal and recreating my other ad-hoc and app store profiles and downloading them again.

我最终从开发人员门户中删除了 XC 配置文件,并重新创建了我的其他临时和应用程序商店配置文件并再次下载它们。

After I did this, when I built and tried to submit to app store, the correct App Store profile showed up AND when I went to export for ad-hoc, the correct ad-hoc profile showed up.

完成此操作后,当我构建并尝试提交到应用商店时,会显示正确的 App Store 配置文件,并且当我进行临时导出时,会显示正确的临时配置文件。

Yay ;)

好极了 ;)

回答by Faisal Memon

I hit a similar problem and discovered that even if you specify the correct profiles in Xcode the Xcode6 system wants you to have the latest (from member centre) provisioning profile (for each team your account is against). It seems to walk each one in turn before using the one you need and gets blocked if you are absent any provisioning profile for the teams you belong to.

我遇到了类似的问题,发现即使您在 Xcode 中指定了正确的配置文件,Xcode6 系统也希望您拥有最新的(来自会员中心)配置文件(对于您的帐户所针对的每个团队)。它似乎在使用您需要的一个之前依次遍历每个,如果您所属的团队缺少任何配置文件,则会被阻止。

回答by drudru

I ran into this.

我遇到了这个。

No solution here worked.

这里没有解决方案。

I ended up moving to a command line build using nomad cli shenzen. Its another great open source project by mattt

我最终转向使用 nomad cli shenzen 的命令行构建。它是 mattt 的另一个伟大的开源项目

Now I go into a shell and just type:

现在我进入一个 shell 并输入:

ipa build

ipa 构建

DONE

完毕

They even have options to send the ipa to whatever Ad Hoc service you want. Awesome.

他们甚至可以选择将 ipa 发送到您想要的任何 Ad Hoc 服务。惊人的。

回答by AlexHsieh

In Xcode 6 (at least 6.1 I am using now)when you are doing the export for ad hoc, xcode 6 will automatically scan if there is any provisioning profile contains all devices registered in the developer account and at the same time match the bundle ID. If no, it will use XC provision profile. Therefore, if you want to use your own profile, for example, for the purpose of push notification, you will need to select all devices in your profile on apple developer portal. I guess that's the reason why some people recreate profile would work and some wouldn't.

在 Xcode 6(我现在使用的至少是 6.1)中,当您进行临时导出时,xcode 6 将自动扫描是否有任何配置文件包含在开发者帐户中注册的所有设备并同时匹配包 ID . 如果不是,它将使用 XC 配置文件。因此,如果您想使用自己的配置文件,例如,出于推送通知的目的,则需要在苹果开发者门户的配置文件中选择所有设备。我想这就是为什么有些人重新创建个人资料会起作用而有些人不会的原因。

回答by Milan Baloh

My way is much simpler:
I go to the developer - provisioning profiles and re-create my Ad Hoc profile by choosing 'Edit' then 'Generate', download it and install with double-click. When exporting .ipa the correct (mine) profile is chosen.
Apple only uses the last built provisioning profile, obviously.

我的方法要简单得多:
我转到开发人员 - 配置配置文件并通过选择“编辑”然后“生成”重新创建我的 Ad Hoc 配置文件,下载并双击安装。导出 .ipa 时,选择了正确的(我的)配置文件。
显然,Apple 仅使用最后构建的配置文件。