问题
I'm trying to create a build for a small group of non-developer testers to do some beta testing on my App before I submit it to iTunes Connect. I have read the Developer's Guide on "Distributing Your App for Testing (you may need to be registered with Apple to read this) as well as Technical Note TN2250 on Ad Hoc distribution, and innumerable blog posts and Stack Overflow articles, but with no success thus far.
Steps I've taken:
- (I'm running Xcode 3.2.5.)
- I've created a Development Provisioning Profile in the iOS Provisioning Portal, and included the devices for all the testers.
- I have downloaded this profile and installed it into Xcode by dragging it to the Organizer window, and I can see the profile under Development>Provisioning Profiles
- I've set this profile as the "Code Signing Identity>Any iOS" in both the project and target settings
- I've created an Entitlements.plist file, set the property list type to "iPhone Entitlements plist", deleted all rows except the "Can be debugged", and set that to unchecked
- I've set the "Code Signing Entitlements" to Entitlements.plist (the exact, case-sensitive name) in both the project and target settings
- I've "Build and Archive"'d my project
- From the Organizer window, I've selected my project & clicked "Share...", selected the same provisioning profile used above and saved the resulting .ipa to disk
- I've compressed the .ipa and the provisioning profile to a zip file and e-mailed it to my testers
The testers have:
- Unzipped the file I sent
- Tried installing by just dragging the .ipa to iTunes and syncing
- Tried installing by first dragging the .mobileprofile to iTunes and syncing
In either case, at the end of syncing, they get the dialog reading "The app [my app name] was not installed on the [their device and device name] because the entitlements are not valid."
It may be worth also noting that I was able to distribute an earlier version of this same App to the same testers last Autumn without any problems and without an entitlements list. I'm not sure what has changed, other than upgrading Xcode.
Can anyone provide any insight or see what I'm doing wrong?
[I have also posted this on Apple's Developer forums and will re-post any solutions here.]
回答1:
The *.ipa file should already contain the provisioning profile. You can see that easily from a Windows machine if you use a zip utility. The file is just a zip archive with a different extension.
Are the devices on the correct version of iOS for the application?
On the devices in Setting > General > Profiles
you can see a list of any provisioning profiles that are installed to eliminate that as an issue. You get multiple copies with every new certificate created when you add new devices. It doesn't hurt to remove all the profiles and check that your latest one gets added.
When you do your build, in the Build Results right click and select Open These Latest Results as Transcript Text File
then search for CodeSign
which will show you the output for that step and you should clearly see which profile was used. You can also search for Entitlements.plist check the path used and then look at that file.
You say you deleted all the rows. I don't have a Can be debugged
entry but I do have
application-identifier
and keychain-access-group
which sound quite code signing related. Here's the plain text version of the file which you could try;
<?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>
<!--- Required entitlements (in most cases shouldn't be changed) --->
<key>application-identifier</key>
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
</array>
<!--- Custom entitlements below --->
</dict>
</plist>
If any of that appears wrong these are the steps Apple suggest in preparing a distribution build;
- Select the Target and open the Build Settings Inspector. Confirm you are in the Distribution Configuration.
- Delete the Code Signing Identity: iOS Distribution : COMPANYNAME
- In the Xcode Build Menu, select Clean all Targets.
- Delete any existing build directories in your Xcode project using Finder.
- Re-launch Xcode and open your Project.
- Re-enter the code-signing identity iOS Distribution : COMPANYNAME in the Target Build Settings Inspector.
- Rebuild your Project.
Hope some of that helps or sparks an ah-ha! moment.
回答2:
Code signing entitlements are no longer necessary for Ad Hoc builds in Xcode 4 - see details notes in Apple Technical Note TN2250
回答3:
- Go to the developer website and sign in.
- Under "Provisioning Profiles" select "Development."
- Open your provisioning profile by double clicking it.
- You will see
"App ID: somenameyouwrote(com.somenameyouwrote)"
- Write down exactly what is between the brackets i.e.
"com.somenameyouwrote"
- In XCode open the .plist file.
- Under
"bundle identifier:"
type whatever you wrote down in step 5. - In XCode Hit the arrow by
"Targets"
and double click the target which will bear the name of your ap. - In the target info window that opens make sure that
"Build"
is selected. - Open the
"Code Signing Identity"
and underneath it select"Any iOS"
. - To the right of
"Any iOS"
select the profile listed whose Ap Identifier matches the one you wrote in the plist. - BAM! Frustration over!
来源:https://stackoverflow.com/questions/5183823/the-app-xxx-was-not-installed-because-the-entitlements-are-not-valid