18

I have reread all the documentation and postings on Ad Hoc distribution and still have a problem. If I try 'wireless' distribution (with a .plist and .ipa file being downloaded using Safari) the app starts to download, the icon is drawn correctly and the name changes from 'Installing..' but when its about 90% complete I get an 'Unable to Download ...' alert.

If I use the iTunes method of transferring the app I get 'The app "xx" was not installed on the iPhone "xx" because the entitlements are not correct.'

Q1: I have read that you no longer need to separately add the .mobileprovision file because XCode (I am using 4.0.1) adds it to the bundle - is this true ?

Q2: when I 'download' the .mobileprovision in safari (on the iPhone) it merely displays it as text. Is this symptomatic of my problem or an irrelevancy ?

Q3: does this problem concern the Entitlements.plist ? I can't find any documentation from Apple or any blogs that relate to what I see when editing this file with XCode 4.0.1. If I follow the instructions (New->New File->Code Signing->Entitlements) I get a default file with only a 'Can be debugged' Key. I have tried setting this to NO, adding a get-task-allow Key (replacing the existing - presumably Can be debugged is the same key ?) adding my application-identifier, and adding an iPhone Entitlements Dictionary with the above two keys in (as per Apple's documentation).

Q4: what is the suicide rate amongst iPhone developers trying to get Entitlements and Code Signing working?

To cut down on suggestions I've seen for similar questions: I do have Code Signing Entitlements set to my Entitlements.plist for Distribution and Release. I have tried restarting XCode, rebuilding, archiving etc I have tried restarting the iPhone I have gone back to the iPhone

Update:In XCode 4.0.1 there is a menu option when the Entitlements.plist is being edited (Editor->Show Raw Keys and Values) which will toggle the key from 'Can be debugged' to 'get-task-allow'

wheeliebin
  • 716
  • 1
  • 6
  • 20
  • Thanks. re 1 - yep seems to be in there. re 3 got rid of everything else and yes it seems to work with Can be debugged = 'NO' (I can transfer with iTunes but not with the wireless method) – wheeliebin Mar 27 '11 at 13:56
  • 6
    "Q4: what is the suicide rate amongst iPhone developers trying to get Entitlements and Code Signing working?" -- LOL :-) – Mike Morearty Jun 16 '11 at 19:34

7 Answers7

13

The entitlements file should be:

<?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>get-task-allow</key>
           <false/>
         <key>application-identifier</key>
           <string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
         <key>keychain-access-groups</key>
           <array>
             <string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
           </array>
</dict>
</plist>

this works for wireless too.
Why on earth the default one doesn't have all this in is something only Apple can answer. I can't see how to edit the raw text of a plist in Xcode so edited in TextEdit.

Jonathan.
  • 53,997
  • 54
  • 186
  • 290
wheeliebin
  • 716
  • 1
  • 6
  • 20
  • 3
    You can right-click on a plist file in XCode and click on Open As > Source Code. No need to leave XCode. – Chuck Smith Jun 02 '11 at 15:39
  • 4
    As of Xcode 4, Entitlements no longer required. It's sort of recommended-against, as it's an additional point of failure. http://developer.apple.com/library/ios/#technotes/tn2250/_index.html%23//apple_ref/doc/uid/DTS40009933-CH1-TROUBLESHOOTING_GUIDE-CODE_SIGNING_ENTITLEMENTS – Olie Aug 29 '11 at 20:08
  • Holy crap it took a while to find this information - thanks. I was not using XCode to build. For anyone not figuring out what $(AppIdentifierPrefix)$(CFBundleIdentifier) means, here's an example: B123PR5C23.com.startup.killerapp. You get the AppIdentifierPrefix from Apple Developer Portal under APP IDs. – Pirkka Esko Sep 08 '14 at 12:47
7

Code signing entitlements are no longer necessary for Ad Hoc builds in Xcode 4 - see details notes in Apple Technical Note TN2250

Cœur
  • 37,241
  • 25
  • 195
  • 267
snibbe
  • 2,715
  • 1
  • 27
  • 34
6

I just wrote a blog post outlining all the steps to successful ad hoc distributions in Xcode 4 which may be helpful. http://www.musicalgeometry.com/?p=1237

jj0b
  • 1,106
  • 1
  • 12
  • 19
1

Entitlements.plist should be added in project and there should be only get-task-allow key inside it.

When debugging on device using developer profile, It should be checked

When building using Ad-Hoc or Distribution profile, It should be unchecked

Regarding Q4: If you like you can increase it by just doing... but I don't recommend it.

Waqas Raja
  • 10,802
  • 4
  • 33
  • 38
  • Thanks. Have just tried removing everything from the Entitlements file except'Can be debugged' which is set to NO and got an improvement in that I can transfer using iTunes but not download using the 'wireless' method. – wheeliebin Mar 27 '11 at 13:52
1

If you right click on the plist file in the project navigator, and select "Open As" then "Source Code", you can edit it as plain source.

Peter Johnson
  • 3,764
  • 1
  • 23
  • 27
1

Maybe they made a shorter version of Entitlements.plist in xcode4. The default Entitlements.plist does not contain the 'application-identifier' and the 'keychain-access-groups' keys, but if you change the value of the 'Can be debugged' key via the 'ASCII Property editor' it really changes the value of the 'get-task-allow' key in the background...

dejo
  • 11
  • 1
1

I tried setting the entitlements parameter "on" or "off", re-download my ad-hoc provisional that had been used for as long as I can remember, and tried hundreds of other combinations. None worked for me until...I went to the provisional portal and recreate a new provisional.

What really got me to stay up until 4:00AM and wasting hours of time that I did not have was how I created the ad hoc provisional. On Apple's iOS provisional Portal page, if you click on the "provisioning" on the left side bar, you will see 4 tabs: "development", "distribution", and the other two. I used to use my provisional created under the "development" tab and added all the test users' phone UUID. That had worked for me for years until the xCode 4 came along, and I was stupid enough to jump on board too fast. Apple engineers had always given me a surprise "mid-night" party every time xCode had an update. And they will wait long enough for me to forget this experience and release the next one.

The solution that worked for me was to create a provisional under the distribution tab. When you create a new provisional here, you have the option of selecting "ad hoc" as the "Distribution Method." After used this provisional on xCode project and target build setting, and turned off "can be debugged" on the entitlements, I then could install via iTunes or via OTA. I hope this tip might help someone save a few gray hair.

Wayne Lo
  • 3,689
  • 2
  • 28
  • 28
  • Creating the provisioning profile under the distribution tab and selecting ad-hoc also worked for me. Creating it under development tab is giving me the error described related to entitlements (0xE8008016) – yeforriak May 10 '11 at 10:51