266
votes

This is for an existing app that compiled and distributed multiple times. Since updating to Xcode 5 I have this error popping.

  1. I have my developers profile selected in the Code Signing for debug.
  2. Deleted the Derived Data a few times.
  3. Quit a few times
  4. Downloaded and tried to re-add my Developers certificates.
  5. Reset my computer! And checked updates
  6. Tried using black magic!
  7. The Scheme > Build Configuration is set to Debug

The odd circumstances I am compiling to compile to iOS 6.1 so I can run on my iPhone 3GS - the base is SDK iOS 7? Could this be an issue? I just need to test it before finding a newer phone to before change it to iOS 7.

20
Check your scheme to make sure you are actually running in debug mode.borrrden
I forgot to mention the Scheme > Build Configuration is set to Debugelliotrock
I'm getting this issue also. In Xcode 4.x no issues. All the settings appear to be the same. Debug symbols should not be stripped in "debug" and scheme runs "debug" for "Run". This is my only code which has this problem. I am using push notifications and shared keychains in this code.DBD
I am going to rebuild the project in xcode5 just sorting repo stuffelliotrock

20 Answers

535
votes

This error tends to appear when you pick an ad-hoc provisioning profile. Make sure that your code signing is for development.

93
votes

This error happens if you have used a Distribution Provisioning Profile for debugging to device.

Go to

Build Settings > Provisioning Profile and set to 'None' for Debugging.

39
votes

I finally solved this by remembering to set code signing and provisioning parameters in BOTH project and target tabs...

37
votes

When your device is connected to your computer with a cable and you Build + Run your app, your device will try to debug. Debugging is only permitted for Development profiles.

  1. If you build + run with a Development Profile + Development Signing Code, everything will be OK

  2. If you build + run with an AppStore Distribution profile + Distribution Signing Code, the app will not even reach your device. This build is only for uploading to AppStore

  3. If you build + run with an AdHoc Distribution profile + Distribution Signing Code, you'll get the "failed to get the task for process..." error, but the app will get installed in your device. Unplug the device and run the app from your device. It's running in distribution environment. Enjoy :)

14
votes

UPDATE:

Xcode 5.1 appears to fix the dropdown so that it now shows a "(blah blah)" whenever two profiles have the same name. This lets you pick the correct one. Which is much better :)


Bitten by this a few times. Xcode5 shows "Provisioning Profile" as a single field, WHICH IS ALWAYS INCORRECT and Apple SHOULD NOT have coded their GUI like this (beginner mistake there from Apple).

In Xcode5 (no previous version), you have two values of "Provisioning Profile". This MUST BE set BEFORE you set your "Code Signing Identity". Obviously, since it has to be set FIRST ... Apple placed it SECOND on the list, 3 items BELOW the thing it has to be set "before".

(bonus points for terrible GUI design there...)

It's also broken: if you have two Provisioning Profiles for the same name, Xcode5 will only allow you to select one of them. To work around this, you have to use iPhone Configuration Utility to find the Profile you want, find the 30-digit "Profile Identifier" and copy/paste it into the "Other" value of the Provisioning Profile dropdown.

Your Provisioning Profile MUST have a value for "Debug" and a different value for "Release" (unless you build a custom mega-profile by hand, Apple keeps the two separate).

The Debug profile will often have the same-name bug described above - most people will be using Apple's auto-generated Team Provisioning Profile, which Apple incorrectly always names the same, for all Targets, in all Projects. (another bug in Xcode5).

Once you've set both values, your "Code Signing Identity" field will finally start working correctly. In fact, it works nicely: in most previous versions of Xcode, this field was broken, and the "automatic" selection rarely worked. In Xcode5, it can ONLY use code-signing values found inside the Provisioning Profile you've pre-selected - and so it seems to get it correct 100% of hte time.

(i.e. you can safely set it to "Automatic". In previous versions of Xcode, Xcode would often "Automatically" use a Distribution profile for a Developer build, and vice-versa, causing lots of problems)

12
votes

Based on my current search, the error "Failed to get the task for process" at xcode 5 could happen for multiple reasons:

  1. One is that we are debugging an application which is signed with distribution ad-hoc provision profile.
  2. Another reason is that somehow xcode5 could not find the correct development provision profile although the coding signing identity has the developer signing identity there.

For me, it is the second case which seems the case as well for this question.

I am able to fix this by changing debug provision profile dropdown to the correct development provision profile and then trying to load the app to real device. Xcode would give this below error: enter image description here

click "Fix issue" to continue, xcode 5 would fix the issue. After the issue is fixed, the provision profile for debug is reset to "None" again, not sure why xcode would do that though.

4
votes

I had this issues and as once I had set both the CODE_SIGN_IDENTITY and the PROVISIONING_PROFILE it all work fine,

Please note this has change in Xcode 5, previous version had no entry for PROVISIONING_PROFILE in build settings

//:configuration = Adhoc
CODE_SIGN_IDENTITY = iPhone Distribution: orgname
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution: orgname

Note that here I had to manually write the iphone developer into the second entry as automatic selection didn't seem to work

//:configuration = Debug
CODE_SIGN_IDENTITY = iPhone Developer: Joe Bloggs (0A0AA00A00)
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer: Joe Bloggs (0A0AA00A00)

//:configuration = Release
CODE_SIGN_IDENTITY = iPhone Distribution: orgname
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution: orgname

Then update and the provisioning profile settings

add you profile ids 0000 are just for privacy

//:configuration = Adhoc 
PROVISIONING_PROFILE = 11111111-1111-1111-1111-111111111111
PROVISIONING_PROFILE[sdk=iphoneos*] = 11111111-1111-1111-1111-111111111111

//:configuration = Debug
PROVISIONING_PROFILE = 00000000-0000-0000-0000-000000000000
PROVISIONING_PROFILE[sdk=iphoneos*] = 00000000-0000-0000-0000-000000000000

//:configuration = Release
PROVISIONING_PROFILE = 22222222-2222-2222-2222-222222222222
PROVISIONING_PROFILE[sdk=iphoneos*] = 22222222-2222-2222-2222-222222222222
4
votes

Try restarting XCode

After setting Provisioning and Code Signing settings from all these suggestions, a restart was what finally allowed it to run with Provisioning set to none and Code Signing set to iOS Developer (Automatic)

4
votes

It may cased by provisioning profiles. For my case, I tried to run the app on my phone and the provisioning profile was set to adhoc profile (XC Ad Hoc), hence the error. I need to change it to iOS Team profile that's managed by xcode (to avoid manual work on dev center).

3
votes

actually,It's your Provisioning Profile --Debug is incorrect。

2
votes

hasan83's answer worked for me. Adhoc provisioning was giving this error and my device was also not included in that provisioning file. I set automatic for provisioning and built. Xcode prompted to fix the issue and thus fixed the issue by downloading and setting the developer provisioning file.

2
votes

In my case, it is because the selected scheme Run action points to another Target, whose Code Signing Identity is set to iPhone Ditributor

1
votes

I have not accepted the answers above as there was a chain of issues that I needed to resolve:

  1. Third party SDK not set as a distribution.
  2. Third party SDK not set to arm64, which I think I caused as I in vain to fix the issue compiled to arm64.
  3. Needed to complete clear out any old certificates and add new ones from Apple. Good thing to do.
  4. Xcode 5 hides the certs and profiles in preferences now I think, which added frustrations.
  5. Then making sure the correct provision profiles are selected across the debug and release settings in your Build settings.

As always thanks for peoples help.

1
votes

So after testing all this options the way I think is correctly is that now you have to create a provisioning profile for development, not only distribution. go to the preferences pane and under the provisioning profiles click on create new, select development and then go to build settings and set the signing to automatic ( this will select the correct provisioning) this made it for me.

I'd have expected Apple to be more informative when they do changes like this default

cheers,

G.

1
votes

Thanks to all the help in the other answers, I solved it like this:

  • Created new, empty project
  • Ran it on the device - it worked fine
  • In the old project, open the "Project, Targets" tab.
  • In Project, set All code signing properties to the same as the new empty project (all off in my case)
  • In Target, do the same for your target.

At this point, it's hard to tell which setting is for which mode of operation so I just started from a project where everything works.

1
votes

Just had the same problem - app was being installed OK, but won't run from Xcode with the "process launch failed: failed to get the task for process".

Turns out my development certificate expired during the night. Regenerating the certificate and the provisioning profiles solved the problem.

1
votes

This problem happend to me because I removed a 'Configuration' under Project => Info.

To resolve this, go to 'Product' => 'Scheme' => 'Manage Schemes'. Edit the active scheme and check if the 'Build Configuration' is not specifying any deleted configurations for each process (Run, Test, etc).

1
votes

In my case Xcode could not automatically set the right iOS Developer Profile for Debug build configuration. I was to set it manually to iPhone Developer: My Name (XXXXXX):

Target Build Settings → Code Signing → Code Signing Identity → Debug.

1
votes

In my case, I can't set the provisioning profile to 'none' because I need a provisioning profile for push notification. So what I did is I just create another provisioning profile on Apple developer, a provisioning profile for iOS developer (not iOS distribution), tied to the same app ID. Then use that provisioning profile for your app in Build Settings tab.

0
votes

In my case, the development team(Xcode 12.2) in the Build settings for Target and Project are different. It worked after using the same team.