ios - Jenkins 无法打开 IOS 模拟器

标签 ios jenkins ios-simulator appium

我在 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/

相关文章:

android - Gradle 任务发布/上传 android apk 到 Http 服务器

jenkins - 将输入步骤显示为弹出窗口,以便在 Jenkins Pipeline 中直观显示

ios - UIImagePickerController 在 iOS 设备上工作但不在 iOS 模拟器上工作?

带有 ios 4.3 的 Xcode 3.2.6,事件可执行文件的问题

iphone - 在 Storyboard 中将核心数据与选项卡栏 Controller 一起使用

ios - 我可以使用 KIF 检查屏幕上是否存在 View 吗?

Jenkins 在舞台 View 中输送更多行

ios - Xcode 模拟器与我的设备。在我的设备上无法正常工作

ios - 像这样自定义 UITextField

iOS HTML 输入标签在可滚动元素中停止滚动