reading the doc from apple I need to create an ad-hoc distribution app, and to do so I need the entitlements.plist. when i create a new entitlement, the value "get-task-allow" is not present, so I added by hand.. is right?? at the end the Entitlements.plist is this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
</array>
<key>get-task-allow</key>
<true/>
</dict>
</plist>
Try, in XCode, to go "new file" and in the wizard select "code signing". Select the "Entitlements" file type.
Just name it "Entitlements.plist". Make sure the task-allow is not checked for adhoc distrobution.
This is all you need to do, no need to "roll your own" :)
(Xcode 3.2.2)
UPDATE:
Since Xcode 4.2 the Entitlements.plist
was removed from the "new file" menu. You now find it under: Project's Targets > Summary
at the bottom of the page.
You can do so. Also you can select your Entitlements.plist in XCode and select in Main Menu: View / Property List Type / iPhone Entitlements plist. Then your key can be selected from dropdown list and will be called "Can be debugged" (as quite as I remember - it should be the only key avaliable in this list)
In XCode 4.2, the Entitlements file has been moved. It's now part of the project root's "Targets" section, at the bottom of the list of the "Summary" items.
I had this same problem. I manually created a new row "get-task-allow", changed type to boolean and actually had to have it set to true to get the device token.
来源:https://stackoverflow.com/questions/3021569/entitlements-plist-not-created-properly