What’s a Security Policy Error?
Hey iPhone developers! Ever seen this one? You try to run or debug your app on the iPhone, but suddenly and for no apparent reason, XCode fails to run the app and throws this error in the runlog: “Error launching remote program: security policy error”?
And you start the pulling of hair and gnashing of teeth and try everything you can think of? But cleaning and rebuilding does nothing to help. Reboot of the device does nothing. Even that most tempting all Mac voodoo, the Needless Reboot of the Mac, does nothing to help.
Fear not, I’ve got the answer. And the simple answer is, you had a provisioning profile on the device expire. Yes, I know the profile for this particular app didn’t fail. Even if the expired provisioning profile has nothing to do with this app, has never been used for this app, has no device ID similarities with this app, your app won’t launch on the device.
Until you delete the expired provisioning profile, that is. Go to the “Organizer” window in XCode, click on the device, and delete the profile. Go to the profile list, and delete the profile there. Once you delete the profile, everything works again, as if magic.