postbuild UIAutomation脚本没有在jenkins中运行

vik*_*kas 13 macos shell ios jenkins ios-ui-automation

我正在尝试为iOS项目进行端到端自动化.我的目标是通过附加脚本作为后期构建操作来自动化持续集成过程.因此,当用户在SVN中检查他的代码并且直到我们获得自动化的测试结果时,一切都将自动化.UIAutomation

Jenkins安装在我的本地计算机上并运行localhost.
现在我已经完成了自动构建过程jenkins,另一方面我准备好了shell脚本,它将UIAutomation在构建输出上运行java脚本.
当我使用我的shell脚本作为后期构建操作时,我在运行instrument命令时遇到错误(在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
Run Code Online (Sandbox Code Playgroud)

然后我用sudo尝试了这个命令然后我得到了以下错误 sudo:没有tty存在并且没有指定askpass程序

请让我知道如何成功运行这些命令,只有这一步留在我的任务中.

小智 2

Jenkins 作为守护进程运行,因此不允许连接到窗口服务器。更多信息请参见http://developer.apple.com/library/mac/#technotes/tn2083/_index.html