109

When I set up my entitlements in my iPhone app project, I create a new Entitlements.plist, and set the value of get-task-allow to false. But why? What does this key represent?

Note this is related to Application could not be verified error when building app for iPhone device - I found that flipping the value of this key to true allowed me to install the app on my device)

0

4 Answers 4

180

From this thread on ADC:

get-task-allow, when signed into an application, allows other processes (like the debugger) to attach to your app. Distribution profiles require that this value be turned off, while development profiles require this value to be turned on (otherwise Xcode would never be able to launch and attach to your app).

8
  • 2
    So are are projects required to have two Entitlements.plist files, one where this value is set to YES that targets Debug profiles, and another that specifies NO, targeting Distribution profiles? Commented Feb 9, 2011 at 1:27
  • 2
    Nevermind, solved my own question. If you leave out Entitlements.plist out of your Debug build settings, you have no problem. Commented Feb 9, 2011 at 1:51
  • 1
    But, I could debug even after Entitlements.plist was not included to the project in Debug mode with Developer profile. Could someone explain me this?
    – spd
    Commented Apr 20, 2012 at 10:52
  • 1
    default for debug is true, default for release is false. Turning it to false will disable debug. Commented Apr 24, 2012 at 1:28
  • 1
    But distribution configs are usually derived from 'release'. Shouldn't that mean that you don't need to specify FALSE for AdHoc? (or for that matters, have an Entitlements file at all?) Commented Jun 16, 2012 at 17:08
21

While your answer is correct, I just want to be more specific on this just so people who want to know what does exactly get_task_allow mean, can.

get_task_allow is an entitlement that allows other apps to get the task port of your app. This means that if any other app runs task_for_pid() with your app process ID they'll get the task port of your app so they can do things like for example writing and reading things on the memory, therefore being able to patch things and modify the behaviour of your app.

If you have a look at how a jailbreak works, you'll notice one of the first things they do is get task_for_pid(mach_task_self(),0,&kernel_task); being that kernel_task is a mach_port_t with value 0, so they are able to touch the kernel's memory.

As kernel entitlements do not have get_task_allow entitlement, and Apple has even removed the possibility of doing tfp0(task_for_pid 0), they need a patch.

So, in essence, given that Xcode needs to access your app's memory and work with it to debug it, you'll need to enable this for debugging, but you'll need to disable this to distribute your app or else any app would be able to get your task port.

1
14

The ability to debug your application on the iPhone.

4
  • 1
    Interesting! If that's all it does, then I wonder why flipping the value to false prevents me from installing the app on my device? (Related SO question: stackoverflow.com/questions/997884/…)
    – Codebeef
    Commented Jun 17, 2009 at 17:58
  • That's what it does...but what does it ACTUALLY do that allows you to do that? Commented Jun 17, 2009 at 20:52
  • 1
    This answer could be greatly improved if it included more information like Codebeef's.
    – Jadar
    Commented Dec 22, 2016 at 18:21
  • @Codebeef I believe this is a restriction that Xcode imposes rather than an inherent one.
    – saagarjha
    Commented Mar 25, 2018 at 2:58
-8

For xcode 4:you have to create Entitlements.plist file from new file. and Targets->build Settings->Code Signing Entitlements you have to write here "Entitlements.plist"

I did this and xcode don not get anymore error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.