Monday, June 8, 2009

How to Get Rid of Security Policy Error

This week, after getting my new MBP, I was trying to deploy my new iPhone application to my testing device (iPhone 3G). After going through all code signing/provisioning issues I managed to deploy my app. However, when GDM tries to run it, I was getting an exception that says “Error from Debugger: Error launching remote program: Security policy Error“.

Security Policy Error

And it was unable to run my sweet app in my device. Everything was working perfectly in Simulator, but not in device. After a little googling, I found the solution. Before going into the tip, I want to let you all know guys, this problem only occurs if your iPhone is jailbroken.

Okayyy, here is the tip: Please just add following lines into your Info.plist file and save the world :)

Apple iPhone OS Application Signing

I hope it saves your day too :) Good luck!

CodeSign error: a valid provisioning profile is required

"CodeSign error: a valid provisioning profile is required for product type 'Application' in SDK 'Device - iPhone OS 2.2"

This error will appear when you update your provisioning profile in iPhone SDK 2.2
or after the expiration of developer certificate and that you have a new provisioning profile from the developer portal

This is the solution (which is modified from

Suppose you have copied your provisioning profile called "iPhone_Development.mobileprovision" to the Library folder and build & go an old iPhone project called "MyApp", and this annoying error appears

(1) cd ~/Library/MobileDevice/Provisioning\ Profiles/

(2) find out the UUID of the provisioning profile
strings iPhone_Development.mobileprovision | grep ".*-.*"

output is like this

(3) copy that UUID between the string tag

(4) close xcode and go to your project
cd ~/Projects/MyApp/MyApp.xcodeproj

(5) Use a text editor to open the project.pbxproj

paste the UUID that you copied from step (3) and put it in both Debug and Release Sections (do multiple finds) for the following line
PROVISIONING_PROFILE = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";

(6) Launch XCode and open the project and build & go again