【问题标题】:Jenkins couldn't open IOS simulatorJenkins 无法打开 IOS 模拟器
【发布时间】:2018-03-16 02:46:54
【问题描述】:

我在 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 是否配置为无头用户?没有密码、bash 环境等?
  • 看起来我们遇到了相同(或至少非常相似)的问题。我将分享我在 Appium 讨论中发布的主题:discuss.appium.io/t/…
  • @KamilSzostakowski 它作为守护进程运行。 jenkins用户是sudoer,确实有需要的环境变量

标签: ios jenkins ios-simulator appium


【解决方案1】:

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

您可以在这里找到complete tutorial

默认情况下,Jenkins 作为守护进程运行。守护进程是一个非交互式后台进程,它作为整个系统的一部分运行,并且不依赖于特定用户。守护进程无法与 GUI 交互。

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

【讨论】:

  • 谢谢,会试试的。
猜你喜欢
  • 2016-04-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-07-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多