xcodebuild code sign error provisioning profile even though all profiles are in correct folder
Solution 1
Look for provision profile id in the profilename.mobileprovision file. Open the file and search for UUID to find this, it will be in XXX-XXX-XXXX format. Pass this as the value of PROVISIONING_PROFILE in xcodebuild command
sudo xcodebuild -configuration Debug PROVISIONING_PROFILE=<Provisioning Profile Id>
Solution 2
if you have the correct certificate,and have imported it. do : sudo xcodebuild -configuration Debug PROVISIONING_PROFILE=""
Related videos on Youtube
Comments
-
kevinl almost 2 years
I have a build server that checks out my xcode projects but there are a couple of issues. I need to build the app if the checkout occurs, but I'm not commiting the .xcworkspace file since more than one person works on the project.
I'm running the following code in my terminal from the project's directory:
sudo xcodebuild -configuration Debug
It eventually fails with the error:
Code Sign error: Provisioning profile '7DXXX-XXXX-XXXX....' can't be found
I opened my directory at:
~/Library/MobileDevice/Provisioning\Profiles/
The profile is definitely there, the certificate is correct, and my debug build does not code sign.
Any thoughts? Thank you.
-
rakmoh over 10 yearsIn the comment above you mentioned the three variations that you have tried. Just want to make sure that you tried with the UUID of the profile. It has been working for me from last few months.
-
kevinl over 10 yearsthanks for the suggestion. I just tried that and it still didn't work. I ended up just calling xcodebuild -configuration Debug -target $TARGET_NAME in my script without calling any profile and it seems to work. I guess whichever developer works on the project just needs to make sure they commit the correct provisioning profiles so that it'll work for my CI server.
-
frank over 10 yearsmake the .p12 file into the keychain 'system' not the 'login'. I dragged it,and it worked! Good luck.
-
Arrush about 9 yearsBTW To get the ID from the file you can use
/usr/libexec/PlistBuddy -c 'Print UUID' /dev/stdin <<< $(security cms -D -i ${WORKSPACE}/FILE.mobileprovision)