2552/01/17

วิธีแก้ไข CodeSign Error

CodeSign error:

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

the: ProjectName.xcodeproj/project.pbxproj file and started snooping around.

I have found that I had multiple Build Configuration sections and my

"PROVISIONING_PROFILE[sdk=iphoneos*]" =
"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
entry had a different number then my installed provisioning profiles.

So here are the steps to get it working again:


1. SAVE YOUR WORK JUST IN CASE THIS SOLUTION DOES NOT WORK FOR YOUR PROBLEM
2. Save your old project file.
3. Go to ~/Library/MobileDevices/Provisioning Profiles
4. Figure out which profile is the one relating to your project. Sometimes the profiles are saved with UUID as the file name so you may have to run grep with your project’s name to figure out which one it is.
$ grep myAppName *
Binary file xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.mobileprovision matches
5. Copy the xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx number.
6. Save your current work and close XCode
7. Go to yourProjectDirectory/ProjectName.xcodeproj/ and using a text editor (MacVim for me) open the project.pbxproj file
8. Find all "PROVISIONING_PROFILE[sdk=iphoneos*]“ entries and replace the assignment value with the number you have copied in step 4.
9. Save the project.pbxproj file
10. Reopen Xcode and recompile your projects. The CodeSign error should be gone.
Powered By Blogger