XCode 4 seems to be doing something different from XCode 3.x.
Do the following steps
Add Entitlements file and set the key value pair for get-task-allow (Can be debugged) to NO. Go to Target build settings, under the Code Signing Entitlements section, add the Entitlements.plist under the “Release” setting and ensure that your Ad Hoc Provisioning profile is selected for “Release” under Code Signing Identity.
Create .ipa and .plist files
- Edit scheme and select destination to device.
- Archive the project (Product -> Archive).
- Go to Archives section in Organizer window.
- Select the archived distribution file
- Click on share… button
- Point the identity dropdown to respective Ad Hoc Provisioning profile
- Click Next
- Select the check box (Save for Enterprise Distribution)
- Fillup the fields (Application URL should point to the .ipa file (complete url))
- Click on save button (It will create .ipa (app) and .plist (manifest) files)
Create an index.html file similar to the following
<title>My Cool app</title>
Install Example Provisioning File</a></li>
Install Example Application</a></li>
Check whether the app.plist contain the full url that points to the .ipa file
Place the files in the server (http://mycoolapp/build/)
Launch the browser in the device and point to http://mycoolapp/build/index.html
Download the provisioning profile and the application.