Search code examples
iosapp-storecode-signing

How to re-sign an iOS app for App Store distribution?


I am trying to understand how the code signing procedure works. My goal is to take an .ipa file that was signed with Company A's Enterprise certificate, change the bundle ID and then sign again with Company B's App Store Distribution certificate and publish to the App Store.

First of all, is this even possible? I read here that "...I’m pretty sure you can’t (and shouldn’t) use this tool to resign an app with an App Store distribution certificate". Can someone elaborate on that?

I have tried many scripts like this and this and this, but after some tweaking they all seem to have the same problem when I try to send the app for review using Application Loader. The errors I'm getting there are:

  • Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate.
  • Unable to extract entitlements from /var/folders/67/(large_number)/new.ipa/Payload/original.app/original

Can anybody help me with that? Please note that I know how to do that by exporting certificates etc -- but here I'm exploring if Company B will be able to do that by themselves, if I give them Company A's .ipa file. I can explain in much more detail what I'm doing if needed - just ask.

Thanks!

EDIT: I am already aware of this closed SO question, however I posted a new one because I think mine is more specific and I'm not asking for a generic way to accomplish what I want - I only want to see if the described scenario is possible.


Solution

  • I have saved a lot of time using the AirSign application (which was not available when I posted my original question).