Why do I get a "security policy error" when launching my iPhone OS app?
I created an iPhone OS 2.2 app some time ago and recently installed the 3.1 SDK.
开发者_开发问答When I try to run my app on my (3.1) iPod Touch, the launch window says "Error from Debugger: Error launching remote program: security policy error."
Viewing the iPod Touch's Console (via the Console tab for my device in Xcode's Organizer) shows:
Wed Feb 3 23:29:17 unknown SpringBoard[24] <Warning>: Unable to launch com.blahblah.Blah_Blah because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user.
Wed Feb 3 23:29:17 unknown com.apple.debugserver-43[789] <Error>: error: unable to launch the application with CFBundleIdentifier 'com.blahblah.Blah_Blah' sbs_error = 9
I already sifted through a bunch of code-signing issues just to get it to build and deploy, so I think this might be something else.
After trying the above solution of deleting expired certs, I was still encountering this issue. Turned out I needed to launch the application manually once and accept the prompt asking if I really wanted to launch that application signed by that profile with that dev account. After accepting that, Xcode was able to successfully launch it subsequent times.
The solution for me was to delete all expired provisioning profiles on the device (even unrelated ones) Window -> Organizer - choose your device and under profiles delete any that have expired. Thanks to: "security policy error" on iPhone and iPod Touch
The problem turned out to be spaces in the executable's filename (I think).
I had previously sorted out a similar problem with bundle identifiers by appending ":rfc1034identifier" to PRODUCT_NAME in my info.plist, but this is a little different.
I'm not sure how to set the executable name directly, but I eventually just changed the Product Name in the "Packaging" section on the "Build" tab for my Target to something that didn't have any spaces. Fixed!
I had the same problem when trying to run on my "newest" iPad after adding the device in XCode. Apparently this device was not in the list of devices for the development profile I was using.
Solution: go to iOS Provisioning Portal, select "Provisioning" on the left hand size, select the 'Development" tab on top and change in the applicable profile in the list on Edit/Modify
Then you can edit the settings for the Certificates to use and add the individual devices.
Then once you connect the device with the XCode organizer, the info on the device will sync automagically. You may then also want to remove the outdated profiles in the Organizer.
Problem solved.
Fixed this issue myself.
Go to Organiser Window Select Provision Profiles from the left hand side Press the refresh button in the bottom right of the window punch in your AppleID and password Feel free to recompile your app
My issue was I updated my profiles to add new devices but did not update the profile in XCode.
精彩评论