【发布时间】:2012-02-06 09:26:03
【问题描述】:
我正在尝试为 iOS 项目 进行端到端自动化。我的目标是通过附加UIAutomation 脚本作为构建后操作来自动化持续集成 过程。
所以从用户在SVN中检查他的代码到我们得到自动化测试结果,一切都会自动化。
Jenkins 安装在我的本地计算机上并在 localhost 上运行。
现在我已经通过jenkins 自动构建过程,在另一端我已经准备好我的shell 脚本,它将在构建输出上运行UIAutomation java 脚本。
当我使用我的 shell 脚本作为构建后操作时,我在运行仪器命令时遇到错误(写在 shell 脚本中),但是如果我通过终端手动运行这个脚本,那么它工作正常。
instruments[64703:60f] -[NSAlert alertWithError:] called with nil NSError. A generic error message will be displayed, but the user deserves better.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL. Mon Feb 6 13:15:20 inpunml310743 instruments[64703] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged. 2012-02-06 13:15:20.179 instruments[64703:60f] Recording cancelled : At least one target failed to launch; aborting run Instruments Trace Error : Failed to start trace. Build step 'Execute shell' marked build as failure Finished: FAILURE
然后我用 sudo 尝试了这个命令然后我得到了以下错误 sudo:不存在 tty,也没有指定 askpass 程序
请告诉我如何才能成功运行这些命令,我的任务中只剩下这一步。
【问题讨论】:
-
Jenkins 是否在您的机器上作为服务运行?如果有,使用什么用户来运行服务?
-
它在 mac 上使用共享帐户,当我们安装软件包时,它没有提供选择位置/用户并将其安装在共享文件夹中的选项。
-
Jenkins 作为守护进程运行,因此不允许连接到窗口服务器。更多信息在这里developer.apple.com/library/mac/#technotes/tn2083/_index.html。
-
@ingorichter 将其作为答案发布。
标签: ios macos shell jenkins ios-ui-automation