我在 jenkins 中设置了一个项目,它应该在运行期间打开 IOS 模拟器,但 jenkins 无法打开模拟器。
Jenkins 在 jenkins 用户中运行。
项目使用如下: - 基于 Java maven 的项目 - 运行 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 }
我尝试将 jenkins 用户添加到开发人员组并启用 DevToolsSecurity,但没有成功。
最佳答案
如果您将 Jenkins 作为守护进程运行,它将无法运行 GUI 应用程序。您必须将其配置为 Launch Agent 或使用本地从站。
在这里你可以找到一个 complete tutorial .
By default Jenkins runs as a daemon. A daemon is a non interactive background process which runs as part of the overall system and is not tied to a specific user. A daemon can’t interact with GUI.
A big part of CI is running simulators and other GUI applications, so we’ll need another option. To fix this, you can change Jenkins to run as a Launch Agent. A launch agent runs in the background on behalf of a user.
关于ios - Jenkins 无法打开 IOS 模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46569413/