Mabedan
Mabedan

Reputation: 907

How to fix Xcode's code sign issues on Jenkins?

I have done the usual steps of making the xcodebuild work on jenkins, which would be installing "keychain & provisioning profiles" plugin, uploading the right keychain+profiles in the plugin's configuration, and using security -v unlock-keychain, and PROVISIONING_PROFILE in the xcodebuild command.

the build goes forward O.K., even runs the defined postbuild scripts defined in the Xcode project, and creates the .app folder with all the necessary content, but fails here...

/Users/Shared/Jenkins/Home/jobs/iOS_feature/workspace/build/Applications/MyApp.app/Frameworks/libswiftUIKit.dylib: User interaction is not allowed.
*** error: Couldn't codesign /Users/Shared/Jenkins/Home/jobs/iOS_feature/workspace/build/Applications/MyApp.app/Frameworks/libswiftUIKit.dylib: codesign failed with exit code 1

Any ideas what could cause this? from what I understand, the Keychain+ProvisioningProfiles are in place since the build doesn't fail here.

Upvotes: 3

Views: 2714

Answers (3)

chedabob
chedabob

Reputation: 5881

Does CodeSign have permission to use the private key?

Whenever I see this error, this is usually the solution:

https://stackoverflow.com/a/22637896/78496

Upvotes: 0

Sam
Sam

Reputation: 5892

firstly, are you passing your keychain password to the security -v unlock-keychain command (using -p)? it's definitely not an ideal solution, because it probably requires exposing your password in clear text on your build server.

our workaround for this problem is to login to the actual machine (remote screen sharing or locally sitting at the machine). run a single build from the desktop, whether it be command line or in Xcode. (you might be asked to "always allow" but i'm not 100% sure under which scenarios this will happen).

from then on, all your remote CI builds should pass through code signing successfully.

Upvotes: 2

imcdnzl
imcdnzl

Reputation: 1151

It's not due to reverse DNS failing or self signed certs on the Jenkins box is it?

We had similar issues though not on Jenkins but Xcode 7 does these extra two checks we found.

Upvotes: 0

Related Questions