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
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

security unlock keychain?jenkinsand using Xcode (notxcodebuild) 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).