1

My environment is:

OSX 10.11 El Capitan
Unity3D 5.3.4f1
Xcode 7.3
Jenkins 1.642.4

The Xcode project file generated by Unity3D build process.

I import Developer & Team certificate to jenkins user's login.keychain

/Users/Share/Jenkins/Library/Keychains/login.keychain

Also copy all Provisioning Profiles to

/Users/Share/Jenkins/Library/MobileDevice/Provisioning Profiles

Build is running fine. And then run

/usr/bin/codesign return exit code 1

I tried many way to fix this.
But is not work yet.

I logged in as jenkins user.
And try to build xcode project
The codesign is build success.

I have no idea to figure out this problem.
Could anyone help me to solve this?

Thanks

Update 1:

sudo su - jenkins

xcodebuild is also failed on codesign.

Update 2:

Screenshot
Build as sudo su - jenkins
Change user to jenkins to build

Logged in as jenkins to build

Jenkins web console output
Only 2 links allow, so here is the address https://i.sstatic.net/dYFOW.png

Update 3:

Maybe the codesign issue could like execute codesign via ssh remote build.
Does any idea to solve this?

Update 4:

I tried ssh.
after security unlock keychain.
It's passed.

Update 5:

Directly run /usr/bin/codesign --force --sign ... pass
But execute xcodebuild still failed on codesign...

Update 6:

security set-keychain-settings -t 3600 -l ~/Library/Keychains/login.keychain

I added this to build step. It was passed built on jenkins.
So the problem maybe is TIMEOUT

God... It's stuck me TWO DAYS...
Thanks everyone.
Have good day

4
  • Are you unlocking the keychain on the command line using security unlock keychain? Commented Apr 14, 2016 at 7:23
  • Yes, but jenkins always build failed. Commented Apr 14, 2016 at 7:37
  • Have you tried logging in as jenkins and using Xcode (not xcodebuild) to build the generated Xcode project? The Xcode project generated by Unity will not have the correct developer id/provisioning profiles set unless you have edited it between generation and build (actually that's probably not true about the provisioning profiles as it can get the right one based on the bundle id, which is set correctly by Unity). Commented Apr 14, 2016 at 7:53
  • OSX jenkins login and open terminal to run xcodebuild passed. That's what I thought the jenkins should pass. But there is not. Thanks. Commented Apr 14, 2016 at 7:58

1 Answer 1

1

1. Got to Xcode -> Preferences -> Accounts -> Choose your account, and then View Details -> refresh the Provisioning Profile. If the refresh button is missing then click on Download All button then restart XCode.

EDIT:

After looking at the picture you posted, I noticed an error before the error you posted. It says "“User interaction is not allowed". So try the following below.

2. KeyChain may be locked: Keychain Access -> Keychain First Aid -> Repair

OR do it by code: https://stackoverflow.com/a/21327591/3785314

3. It could be a timeout issue when building. Try

security set-keychain-settings -t 3600 -l ~/Library/Keychains/login.keychain

4. Login your build user via the GUI and open Keychain Access. Select your signing private key, right-click, choose Get Info, change to the Access Control tab and select the "Allow all applications to access this item". enter image description here

"User interaction is not allowed" trying to sign an OSX app using codesign

Sign up to request clarification or add additional context in comments.

6 Comments

Thanks, but I logged in as jenkins user was built success. So I think is not this problem.
I don't know what jenkins. Open your project with xcode and do what is in my answer then re-start it and then close it again. It will update the certificate in project. Now try your build command with jenkins again...
Done. But still failed. Thanks for your answer.
I updated my answer. If that doesn't work then I can't help.
I already allow all applications to access. Terminal build success. But Jenkins failed. Thanks again.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.