简体   繁体   中英

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.

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 ):

unzip app.ipa

rm -rf Payload/MyApp.app/_CodeSignature/

cp ~/Downloads/AdHoc.mobileprovision Payload/MyApp.app/embedded.mobileprovision

codesign -f -s "iPhone Distribution: Company Certificate" --resource-rules Payload/MyApp.app/ResourceRules.plist Payload/MyApp.app

zip -qr app-resigned.ipa Payload/

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.

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.

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:

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

Answered with help of Martin H, in the comments of the original answer.

To recap: When app is signed with a Developer Profile, you'd need to add entitlements when resigning with distribution profile.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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