17

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.

steventnorris
  • 5,656
  • 23
  • 93
  • 174
  • In addition to this, the provisioning profile used must have all devices checked in order to be valid for an ad hoc build release. – steventnorris Nov 20 '14 at 16:05

7 Answers7

8

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.

Bruno Bronosky
  • 66,273
  • 12
  • 162
  • 149
7

Using a development certificate, I was unable to generate an .ipa. However, using a distribution certificate for ad hoc, I could generate an .ipa. I'm assuming this is either a new 'feature' or a bug in Xcode 6 that requires ad hoc to have a distribution certificate and profile to deploy via ad hoc.

steventnorris
  • 5,656
  • 23
  • 93
  • 174
  • I am using Xcode 6.01 and still cant generate ipa with devepoment certificate. It automatically chooses distribution cert. Has anybody solved that? – DixieFlatline Sep 19 '14 at 14:05
  • 2
    @DixieFlatline as mentioned above, you need to create a new AdHoc distribution profile from Member Center (development certificate is no longer allowed for Ad Hoc deployment) – cdescours Sep 23 '14 at 16:18
  • Debugging with Safari's web console requires apps with development provisioning profile only. This means that I can no longer distribute the app for Safari-console QA, unless I hook and run each QA device to XCode and run it directly first. Any solution? – Tal Yaniv Nov 05 '14 at 12:33
  • @TalYaniv From what I've researched, there are a few possible options. I haven't tested these, but some seem to have luck with command line utilities for building IPAs and others just keep an old version of XCode to build with, although that will limit you on your SDK I would imagine. Reading through this may give you some more information. http://stackoverflow.com/questions/25999847/xcode-6-and-ad-hoc-distribution-without-xc-provisioning – steventnorris Nov 05 '14 at 15:58
  • @TalYaniv See Andre's answer above for command line suggestions. – steventnorris Nov 05 '14 at 15:59
  • I think the problem people are having with this answer is that it says "using a distribution certificate for ad hoc" and doesn't clearly explain what that means. It's not enough to simply: **1.** Create it at developer.apple.com; **2.** Download and open it with Xcode; It's all for naught unless you go 1 step forward and **3.** Change your "Code Signing Identity" under Build Settings to "iOS Distribution". – Bruno Bronosky Mar 11 '15 at 15:56
2

The only way I could generate the AdHoc build (without getting rid of my certificates) was using the command line tool xcbuild as described here:

https://stackoverflow.com/a/25979784/2008167

Community
  • 1
  • 1
1

For me worked following.

  1. Delete distribution profiles from developer portal.
  2. Create new one
  3. Clear and re-archive
Garnik
  • 423
  • 1
  • 6
  • 20
0

For me the following worked instantly:

  1. Go to keychain access

  2. Delete the trash keys that Xcode or last Mac OS update recovered.

  3. Leave only the "public key" with the "private keys" which contain a litte triangle beside them (which when clicked shows the certificate).

After deleting these thrash keys Xcode 6.0.1. managed to archive a add hoc app for OTA distribution.

This helped me, hope it helps you guys. Gl :)

MB_iOSDeveloper
  • 4,178
  • 4
  • 24
  • 36
0

This is what worked for me. Hope it helps

  1. Delete both the Dev and AdHoc profiles for the particular application from your Mac. (I use Configuration Utility for that)
  2. Quit and then Launch Xcode
  3. Download the provisioning profiles from Apple Dev Portal
  4. Select the new Provisioning from Code Sign Settings
Qamar Suleiman
  • 1,228
  • 2
  • 18
  • 31
0

Here's the short version of what worked for me (naturally I had spent hours trying everything else first):

NOTE: Instructions are for Xcode 6.3.2.

  1. Create and install new distribution certificate.
  2. Uninstall old certificate.
  3. Switch provisioning profile to new cert.
  4. Perform Archive. If you're okay with changing your cert, feel free to stop here.
  5. Switch provisioning profile back to original cert.
  6. Perform Archive. Should now work.

Here's the long, detailed version:

  1. Delete the existing Distribution certificate in your Keychain.
  2. Create a new Distribution certificate in the Apple Member Center.
  3. Download and install the new certificate.
  4. Change the project AdHoc provisioning profile to use this new certificate.
  5. In Xcode, click Preferences in the Xcode menu.
  6. Click View Details...
  7. Right Click a provisioning profile at the bottom and choose Show in Finder.
  8. Delete all files in that folder.
  9. Click the refresh button at the bottom of the window in Xcode.
  10. Attempt the Archive again, it should work. Stop here if you're okay with changing certificates regularly.
  11. Delete the new certificate from your Keychain and reinstall the old one.
  12. Change the provisioning profile back to the original certificate.
  13. Repeat the deleting and refreshing of the provisioning profiles.
  14. Attempt the Archive again, it should work. Upload this version.
Jason
  • 2,455
  • 4
  • 37
  • 48