问题
My Jenkins building job is failing with the following message
=== BUILD NATIVE TARGET MyTarget OF PROJECT MyProject WITH CONFIGURATION Debug ===
Check dependencies
Code Sign error: A valid provisioning profile matching the application's Identifier 'MyCompany.MyProjet' could not be found
Now,if I try to run the xcodebuild command as jenkins user with a selected scheme:
/usr/bin/xcodebuild -target MyTarget -configuration Debug clean build
or this
/usr/bin/xcodebuild -scheme MyAwesomeScheme clean build
I get the same error,BUT if I execute it as another user (my system main user) the build is successfully completed!!! It also works in Xcode.
This error start appearing after I fixed another code signing error copying my certificates in both Login and System keychain group.
It looks like the jenkins user cannot access the provisioning profiles. Any idea how to fix it?
回答1:
You need to create the directory ~/Library/MobileDevice/Provisioning Profiles/
for the Jenkins user.
Next, copy the .mobileprovision files into that directory.
Last, set the provisioning profile in the Target build settings. 'Automatic Profile Selector' doesn't work with xcodebuild.
回答2:
found a possible solution here http://code-dojo.blogspot.co.uk/2012/09/fix-ios-code-signing-issue-when-using.html
回答3:
@Luke your answer helped me to move further.
I had to set up Code Signing Identity
field with the whole profile (e.g. iPhoneDeveloper: NameSurname (XXXXXXXXX) )
+
set up full path to .mobileprovision file (/Users/username/Library/MobileDevice/Provisioning Profiles/test.mobileprovision) in Embedded Profile
field
my current Jenkins version is 1.549
来源:https://stackoverflow.com/questions/13295773/error-building-ios-app-on-jenkins-macosx-server