来自Jenkins / SSH的Xcode,Codeign错误 - “不允许用户交互” [英] Xcode, Codesign Error from Jenkins / SSH - "User Interaction is not allowed"

查看:184
本文介绍了来自Jenkins / SSH的Xcode,Codeign错误 - “不允许用户交互”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Jenkins上运行自动xcodebuild,但我遇到了错误

I am trying to run an automated xcodebuild on Jenkins, but I am running into the error

不允许用户交互。
命令/ usr / bin / codesign失败,退出代码为1

User interaction is not allowed. Command /usr/bin/codesign failed with exit code 1

我已经引用"不允许用户互动尝试使用协同设计和其他类似的线程签署OSX应用程序,但没有一个解决方案似乎能够正确地纠正错误。

I have already referenced "User interaction is not allowed" trying to sign an OSX app using codesign and other similar threads, but none of the solutions seem to properly remedy the error.

以下是我已经尝试的内容:

我已经将钥匙串设置为不会通过Keychain Access的设置和命令自动锁定超时

I have set the keychain to not automatically lock with a timeout, both through Keychain Access's settings, and through the command

security set-keychain-settings -t 3600 -l <KEYCHAIN>


  • 我试过调用

  • I have tried calling

    codesign --sign <CODE SIGN IDENTITY> --force ...
    

    (更具体地说,此解决方案https://stackoverflow.com/a/20208104 ),
    虽然这成功地构建了项目,但我认为在编译之前我不认为是编码是正确的还是可靠的(编辑:从jenkins运行时也失败了)

    before the project compiles (more specifically, this solution https://stackoverflow.com/a/20208104), and although this successfully builds the project I don't think that codesigning before compiling is correct or reliable. (edit: this also failed when run from jenkins)

    以下是我正在执行的命令:

    security unlock-keychain -p <PASSWORD> <KEYCHAIN>
    xcodebuild -scheme <SCHEME> -workspace <WORKSPACE> -derivedDataPath <BUILD DIRECTORY> -configuration <CONFIGURATION> "CONFIGURATION_BUILD_DIR=<BUILD DIRECTORY>" "CODE_SIGN_IDENTITY=<CODE SIGN ID>" "PROVISIONING_PROFILE=<PROVISIONING PROFILE>" clean build
    

    需要注意的一点是,在机器上构建项目可以使用上面的命令,但是试图通过ssh(和jenkins)运行完全相同的命令会导致错误。

    Something interesting to note is that building the project on the machine works with the commands above, but trying to run the exact same commands over ssh (and jenkins) causes the error.

    谢谢提前寻求帮助!

    Thanks in advance for your help!

    推荐答案

    Apple不支持SSH运行自动构建它们是无头,所以通过SSH运行可能是这里的问题:

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


    运行GUI
    应用程序不支持LaunchDaemons提供的上下文。 SSH服务和Jenkins的默认设置都是
    ,都是作为LaunchDaemons实现的。在早期版本的Xcode 5
    xcodebuild可以在这个上下文中运行iOS模拟器上的测试,但
    从来都不是支持的配置,并且你已经注意到
    不再起作用了Xcode 6。

    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.

    与LaunchDaemons不同,LaunchAgents提供了一个上下文,您可以在其中运行
    GUI应用程序 - 如果用户当时已登录,则使用窗口
    服务器/ Aqua会话。将Jenkins配置从作为LaunchDgent的
    转换为LaunchAgent将避免报告的
    问题。您还可以使用launchd在SSH模拟器上运行测试
    ,通过制作LaunchAgent并手动
    加载/启动它,或者使用launchctl submit。

    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?

    这篇关于来自Jenkins / SSH的Xcode,Codeign错误 - “不允许用户交互”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆