Have you ever seen this message when building an Xcode project in Jenkins:
"workspace/build/MyApp.app: User interaction is not allowed."?
This wiki page suggests clicking the ‘Always Allow’ button when asked. I would if I could.
Here’s how I’ve set it up. First, before an Xcode build step add an
Execute shell step with the lines:
There is no password on that keychain, to ease the setup (http://stackoverflow.com/questions/577750/running-xcodebuild-from-a-forked-terminal/581002#581002). It should’ve done the trick, and it used to, but after a while the build process would fail.
Luckily, this post has directed me to the right track:
If you try ‘security show-keychain-info keychain-file’ then you’ll get the error “User interaction is not allowed”, and that’s a phrase to search with for some more info.
When I tried that:
1 2 3 4
Well, well, I’d expected that. Let’s
unlock that first:
1 2 3 4
timeout=300s. It hit me that while the project is built by Jenkins, more than 5 minutes pass (due to the long process of JS&CSS compressing, but that’s another topic) and the keychain is locked again. We should fix that:
1 2 3
I’ve setup the timeout to 1 hour, which should be more than enough. Now there is no this issue anymore.
ps. Another Jenkins and Xcode related post is here: Jenkins, Xcode: “No matching provisioning profile found”.