詹金斯无法打开IOS模拟器

问题描述:

我有一个项目setuped在詹金斯应该在运行期间打开IOS模拟器,但詹金斯无法打开模拟器。詹金斯无法打开IOS模拟器

詹金斯在jenkins用户中运行。

下面是什么项目用途: - Java的行家基于项目 - 运行appium服务器 - appium启动IOS模拟器 - 这一步失败,下面的错误

[XCUITest] Error: Command 'osascript -e 'tell application "System Events" to count processes whose bundle identifier is "com.apple.iphonesimulator"'' exited with code 1 
    at ChildProcess.<anonymous> (../../lib/teen_process.js:92:19) 
    at emitTwo (events.js:125:13) 
    at ChildProcess.emit (events.js:213:7) 
    at maybeClose (internal/child_process.js:897:16) 
    at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5) 
{ Error: Command 'osascript -e 'tell application "System Events" to count processes whose bundle identifier is "com.apple.iphonesimulator"'' exited with code 1 
    at ChildProcess.<anonymous> (../../lib/teen_process.js:92:19) 
    at emitTwo (events.js:125:13) 
    at ChildProcess.emit (events.js:213:7) 
    at maybeClose (internal/child_process.js:897:16) 
    at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5) 
    stdout: '', 
    stderr: '36:106: execution error: An error of type -610 has occurred. (-610)\n', 
    code: 1 } 

我尝试添加詹金斯用户开发人员组并启用DevToolsSecurity,但它不起作用。

+0

您的Jenkins配置为无头用户吗?没有密码,bash环境等? –

+1

看起来我们有相同(或至少非常相似)的问题。我将分享我在Appium讨论中发布的主题:https://discuss.appium.io/t/appium-tests-via-jenkins-simulator-not-boot-error-command-osascript-e-tell-application -system-events-to-count-processes-which-bundle-identifier-is-com-apple-iphonesimulator/19038 – Cindy

+0

@KamilSzostakowski它作为deamon运行。 jenkins用户是sudoer,它确实需要环境变量 –

如果您将Jenkins作为守护程序运行,它将无法运行GUI应用程序。您必须将其配置为启动代理或使用本地从站。

在这里您可以找到一个complete tutorial

默认情况下,詹金斯作为守护进程运行。守护进程是一个非交互式的后台进程,作为整个系统的一部分运行,不受特定用户的束缚。守护进程不能与GUI交互。

CI的很大一部分是运行模拟器和其他GUI应用程序,所以我们需要另一个选项。要解决这个问题,您可以将Jenkins更改为运行Launch Agent。代表用户在后台运行启动代理。

+0

谢谢,会试试看。 –