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 i.stack.imgur.com/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

Cloud
  • 13
  • 1
  • 4
  • Are you unlocking the keychain on the command line using `security unlock keychain`? – trojanfoe Apr 14 '16 at 07:23
  • Yes, but jenkins always build failed. – Cloud Apr 14 '16 at 07: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). – trojanfoe Apr 14 '16 at 07: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. – Cloud Apr 14 '16 at 07:58

1 Answers1

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

Community
  • 1
  • 1
Programmer
  • 121,791
  • 22
  • 236
  • 328