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.

This entry was posted on Wednesday, September 2nd, 2009 at 11:55 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

10 Responses to “What’s a Security Policy Error?”

  1. Orin

    Thanks a ton! I would never have thought of doing that, but it worked like a charm.

  2. FyKnight

    Thank you for this! If only I’d searched before wasting half an hour on the same problem. I’d sent a build to a tester and they were able to install it but not run it (got an alert) due to having previous expired provisioning profiles on their phone! For a different app!

    So it seems all the development apps refuse to run if there are _any_ expired provisioning profiles on the phone, even if they have different App IDs, etc.

  3. Lakshmikanth Reddy

    Hey, thanks a lot, this is really magic.

  4. steven

    you are genius godsend thank you!

  5. Brian F

    Awesome, thank you much!

  6. kode80

    Awesome this has to be my quickest provisioning fix yet! It may be worth noting that in my case the offending profile did *not* show up in the Xcode organizer – I checked in “Profiles” on the device however and sure enough there it was.

  7. Mark Knopper

    Just adding my thanks – this solved my problem.

  8. Manoj

    Thank you, your solution is the coolest solution for Remote debugging.

  9. Stephen

    Thanks. I was heavily into paragraph two of your post until I found this.

  10. S Woodside

    Awesome. Even simpler solution — just delete ALL the provision profiles on your device. Then let XCode prompt you to re-install them.

Leave a Reply

Your comment