ios – postbuild UIAutomation脚本不在jenkins中运行

前端之家收集整理的这篇文章主要介绍了ios – postbuild UIAutomation脚本不在jenkins中运行前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在努力为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默认安装为LaunchDaemon,这意味着它没有足够的权限启动WindowsServer.

您需要将其配置为LaunchAgent:

sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
sudo mv /Library/LaunchDaemons/org.jenkins-ci.plist /Library/LaunchAgents/org.jenkins-ci.plist

然后登录为Jenkins并保持会话打开.

如果您不知道Jenkins密码,您可以通过以下方式更改密码:

sudo passwd jenkins
原文链接:https://www.f2er.com/iOS/336887.html

猜你在找的iOS相关文章