xcode 如何对 iOS .xarchive 进行代码签名,以便客户端可以正确辞职?(使用推送通知)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9708090/
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
How can I code sign an iOS .xarchive so a client can resign properly? (using push notifications)
提问by pj4533
I need to create an iOS .xarchive file using a developer profile, that a client can resign using their distribution profile(s).
我需要使用开发人员配置文件创建一个 iOS .xarchive 文件,客户可以使用他们的分发配置文件辞职。
(I have read this but it didn't have any real solutions: How can I send iOS app to client, for them to code-sign)
(我已经阅读了这个,但它没有任何真正的解决方案:如何将 iOS 应用程序发送到客户端,让他们进行代码签名)
The client doesn't want to share their private keys, nor give me access above 'Developer' in the member center. And we don't want to share our source code.
客户不想共享他们的私钥,也不想让我访问会员中心的“开发人员”上方。我们不想分享我们的源代码。
We need to support push notifications, so this means we need a fully qualified app id.
我们需要支持推送通知,所以这意味着我们需要一个完全合格的应用程序 ID。
I cannot figure out a way that allows me to build and export an .xarchive signed with 'aps production', 'get-task-allow' as false, BUT ALSO using the certificate that matches the clients distribution certificate.
我想不出一种方法可以让我构建和导出一个 .xarchive 签名的 'aps production','get-task-allow' 为 false,但也使用与客户端分发证书匹配的证书。
This feels like a bug in Xcode, shouldn't the changes to 'aps production' and 'get-task-allow' be tied to the configuration, not the type of provisioning profile? I am using 'Release', but with my developer profile.
这感觉像是 Xcode 中的一个错误,对“aps production”和“get-task-allow”的更改不应该与配置相关联,而不是与配置文件的类型相关联吗?我正在使用“发布”,但使用我的开发人员资料。
Am I missing something, or is this just not possible?
我错过了什么,或者这是不可能的?
采纳答案by pj4533
I figured out the answer to this question through trial and error. Even though tech notes and most web resources say you don't need an entitlements.plist if you are using XCode4+, there are certain cases where you do. Two cases are represented by my question above:
我通过反复试验找到了这个问题的答案。尽管技术说明和大多数网络资源都说如果您使用 XCode4+,则不需要 entitlements.plist,但在某些情况下您需要这样做。我上面的问题代表了两种情况:
- building Release configuration (i.e.: Archive), but signing with a Developer provisioning profile
- using push notifications
- 构建发布配置(即:存档),但使用开发人员配置文件签名
- 使用推送通知
My final custom entitlements.plist has 3 values:
我的最终自定义 entitlements.plist 有 3 个值:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>get-task-allow</key>
<false/>
<key>aps-environment</key>
<string>production</string>
<key>keychain-access-groups</key>
<array>
<string>L23874DF.com.your.appid</string>
</array>
</dict>
</plist>
Once I had that in my entitlements.plist, I built with the developer provisioning profile for this app id. Then I archived it, and exported the archive from the organizer. Once exported, I sent it to my client. The client was able to resign the archive with an ad hoc profile, and send me back an IPA file, which I loaded onto my device. I also successfully received a push notification from Urban Airship to this IPA!
一旦在我的 entitlements.plist 中设置了它,我就使用该应用程序 ID 的开发人员配置文件进行构建。然后我将其存档,并从组织者中导出存档。导出后,我将其发送给我的客户。客户端能够使用临时配置文件退出存档,并将 IPA 文件发回给我,我将其加载到我的设备上。我也成功收到了 Urban Airship 给这个 IPA 的推送通知!