简体   繁体   English

手动重新签名的IPA无法在APNS中注册

[英]Manually re-signed IPA fails to register with APNS

We've received an IPA from our vendor signed with a dev provisioning profile, to test Prod Push messaging we manually resigned the IPA with an AdHoc profile. 我们已经收到来自供应商的IPA,该IPA带有dev设置配置文件,为了测试Prod Push消息传递,我们使用AdHoc配置文件手动将IPA签名。

The app installs and runs fine on the device, but fails to register for Push Messaging. 该应用程序可以在设备上安装并正常运行,但无法注册推送消息。

Here's what we did (followed this https://coderwall.com/p/cea3fw ): 这是我们所做的(紧随https://coderwall.com/p/cea3fw之后 ):

unzip app.ipa 解压app.ipa

rm -rf Payload/MyApp.app/_CodeSignature/ rm -rf有效负载/MyApp.app/_CodeSignature/

cp ~/Downloads/AdHoc.mobileprovision Payload/MyApp.app/embedded.mobileprovision cp〜/ Downloads / AdHoc.mobileprovision有效负载/MyApp.app/embedded.mobileprovision

codesign -f -s "iPhone Distribution: Company Certificate" --resource-rules Payload/MyApp.app/ResourceRules.plist Payload/MyApp.app codesign -f -s“ iPhone发行:公司证书” --resource-rules Payload / MyApp.app / ResourceRules.plist Payload / MyApp.app

zip -qr app-resigned.ipa Payload/ zip -qr app-resigned.ipa有效载荷/

Sideload to device, app launches, but fails to register for push. 侧载到设备,应用启动,但未注册推送。

Since then the vendor sent us a xacrchive file, which we can successfully export signing it via xcode, but we're still curious as to why code sign didn't work on the IPA. 从那以后,供应商向我们发送了一个xacrchive文件,我们可以通过xcode成功导出对其进行签名,但是我们仍然对为什么代码签名在IPA上不起作用感到好奇。

This is to encapsulate my comment as an answer - the solution is to force the aps-environment entitlement into the .app built file by using an Entitlements.plist file. 这是为了封装我的评论作为答案-解决方案是通过使用Entitlements.plist文件将aps-environment权利强制到.app构建的文件中。

This is something that can be necessary to do in a few situations, here's an example when using the Xcode bot build system fails for builds involving push: 这在某些情况下可能是必须要做的,下面是一个示例,当使用Xcode机器人构建系统无法进行涉及push的构建时:

IPA created via Xcode bot fails to run for APNS but runs if built manually via Xcode itself or built as an archive by Xcode 通过Xcode机器人创建的IPA无法为APNS运行,但如果通过Xcode本身手动构建或由Xcode存档则运行

Answered with help of Martin H, in the comments of the original answer. 在原始答案的评论中,由Martin H回答。

To recap: When app is signed with a Developer Profile, you'd need to add entitlements when resigning with distribution profile. 回顾一下:使用开发者资料对应用进行签名后,使用分发资料进行签名时,您需要添加权利。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM