3

I submitted a new version of my Mac OS App to the App Store. It was rejected because it crashed in review due to an iCloud exception. The problem: No matter what I try, I am not able to reproduce the problem locally.

Apple told me that I have to run my tests on the exact same version I submitted for review. That makes sense of course, but how can I do this?

Since the App uses iCloud the iCloud entitlement is included. Since I submitted this version to the App Store it is signed with a Distribution Profile. When I try to execute the app file I extracted from the submitted .xcarchive it is killed immediately. Console shows:

taskgated-helper[51673]: Starting taskgated-helper
taskgated-helper[51673]: embedded provisioning profile not valid: file:///Users/AUser/Library/Developer/Xcode/Archives/2014-02-07/MyApp.xcarchive/Products/Applications/MyApp.app/Contents/embedded.provisionprofile
taskgated-helper[51673]: returning 2 provisioning profiles
taskgated-helper[51673]: none of the 2 applicable provisioning profile(s) apply
taskgated-helper[51673]: CPValidateProvisioningDictionaries returning NO with error: (null)
taskgated[13]: killed com.example.MyApp[pid 51671] because its use of the com.apple.developer.ubiquity-container-identifiers entitlement is not allowed (error code -67050)

So, how can I test the exact version I submitted when I cannot run it? Running a version that was compile in Release mode using a Development Profile is not problem. Is there any way to resign the submitted version with a Development Profile?

However, even if I am able to resign and run the submitted version, would this still be the exact version I submitted?

Andrei Herford
  • 17,570
  • 19
  • 91
  • 225

1 Answers1

3

meanwhile I got an answer directly from Apple. I add it here in case someone has the same trouble:

Running an App that uses iCloud and that was signed with a Distribution Profile on a local machine is NOT possible. This will only work once the app was downloaded from App Store.

To be able to test such an app locally one can simply re-distribute it using the organizer:

  • Open the Organizer in Xcode
  • Select the Archive that was submitted for review
  • Click on "Distribute..."
  • Select "Export as" and "Application"
  • Click on Next and select a Development Profile to re-sign the app

This way you will re-sign the exact same build that was submitted to review with your Development Profile and you will be able to execute the app locally. You can also attach the Xcode debugger to this app to get all the information you need.

Of course this is not the exact same app as the one that was submitted for review but according to Apple this does not matter. Only the signature is different but the actual build is the same.

In my case I was still not able to re-produce the crashes that happend in review but this is another story...

Andrei Herford
  • 17,570
  • 19
  • 91
  • 225
  • 4
    And how do you do that with Xcode 6? If I select export then export as a mac application, then it won't give me the opportunity to select a profile :( – MetaImi Nov 20 '14 at 08:58
  • @MetaImi How I resolved this, is to "manage schemes" and ensure that "Archive" uses my "Debug" Build configuration. Then when you export, the embedded provisioning profile will be a dev one. – Damien Nov 30 '14 at 15:42