Xcode 6 GM creating archive

steventnorris picture steventnorris · Sep 10, 2014 · Viewed 15.6k times · Source

I am attempting to create an archive .ipa for distribution via testflight. The archive creates, and I choose export, then choose ad hoc, then select my team. However, at this point I get the below screen.

enter image description here

I know that my certificate is valid, as I created an .ipa in xcode 5 with a different provisioning profile about 2 hours before I downloaded xcode 6 GM. I also know that my provisioning profile is valid and connected to said certificate.

Thing is, in xcode 5 it didn't ask for a team; it only asked for a provisioning profile. Now, export asks for a team, which I provide. Also, of course I have a valid iOS Distribution certificate. I'm using it in the build settings to sign my application. Seems like a strange error to get

Any help would be greatly appreciated.

Answer

Bruno Bronosky picture Bruno Bronosky · Jan 8, 2015

You have to change your "Code Signing Identity" to "iOS Distribution"

First of all understand that the error message is a BS repurposed message and not accurate to what is happening here. It's not your fault you have wasted so much time on this. This is an example of 1 small flaw in Apple's workflow costing hundreds of thousands of dollars in wasted developer time. But what can we do?

  1. Make sure you have a VALID Provisioning Profile for Ad Hoc distribution in Developer Member Center and download it to your Mac. (This is an important detail as you probably didn't have one of these prior to Xcode 6 because it wasn't required.)
  2. Open the *.mobileprovision file by dragging it to the Xcode icon in your dock.
  3. In Xcode go to Build Settings and find "Code Signing Identity" under "Code Signing".
  4. It's probably going to be set to "iPhone Developer". Change it to "iOS Distribution", even though that sounds like you're making an App Store build.
  5. Find "Provisioning Profile" in Xcode under "Code Signing". Make sure that your Ad Hoc provisioning profile is present in the dropdown list, but select Automatic.
  6. Now you can do: Product > Build; Product > Archive; Export...; And all should be well.

Xcode 6

This is technically the same idea as @steventnorris. I wanted to be more clear because I failed recognize and implement his answer. I had to discover this on my own through much trial and error.