Xcode, Codesign Error from Jenkins / SSH - “User Interaction is not allowed”

♀尐吖头ヾ 提交于 2019-11-29 20:44:27

SSH is not supported by Apple to run automated build as they are headless, so running via SSH could be the issue here:

The context provided by LaunchDaemons is not supported for running GUI applications. The SSH service, and the default setup for Jenkins, are both implemented as LaunchDaemons. In earlier versions of Xcode 5 xcodebuild could run tests on the iOS simulator in this context, but that was never a supported configuration, and as you have noted that is no longer working as of Xcode 6.

Unlike LaunchDaemons, LaunchAgents provide a context where you can run GUI applications - if the user is logged in at the time, with a window server / Aqua session. Converting your Jenkins configuration from being a LaunchDaemon to being a LaunchAgent would avoid the reported issue. You can also use launchd for running tests on the iOS simulator from a SSH session, either by crafting a LaunchAgent and manually loading / starting that, or by using "launchctl submit”.

Have you tried using web agent instead?

Just in case anyone missed it. The answer in the linked question resolves the issue. Basically you need to run security -v unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN". I run this before the build and the codesign succeeds.

Put your keys in the System keychain instead of Login/iCloud/Local Items.

Install the XCode plugin here: https://wiki.jenkins-ci.org/display/JENKINS/Xcode+Plugin

Choose the option to unlock the keychain and supply the path to the keychain. e.g. ${HOME}/Library/Keychains/login.keychain

Make sure you set the $HOME environment variable. From experience it's just easier to have the machine login as a user just like a developer would.

I've been through this problem with Jenkins Xcode plugin.

I just check Unlock Keychain ?

in

Xcode - Code signing & OS X keychain options

to make my build run.

The automated build (Jenkins w/remote SSH), which uses productsign, worked well until we upgraded the build box from Yosemite to Sierra.

productsign[4065:51711] Error configuring RSA signing: User interaction is not allowed. (-25308)

We tried different solutions found on SO, but none worked.

Eventually, I fixed it doing following:

  1. Open Keychain, go to Preferences
  2. Click 'Reset my Default Keychain'
  3. Message 'operation not permitted' or similar shows up
    • Error did not make any sense since user is administrator
    • login keychain gets removed, but not re-created.
  4. Logout and login again
    • new login keychain appears
    • productsign works again (through automated build)

Please note our 'Developer ID Installer: ACME, Inc (12345ABCDE)' certificate is in the System keychain.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!