Build Unity project with Jenkins failed

匿名 (未验证) 提交于 2019-12-03 02:49:01

问题:

I'm trying to build Unity project with Jenkins on Mac OS Server. But when I try to run the following script

/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode ${PROJECT_PATH} -executeMethod BuildScript.DevelopmentBuild 

The script shows this,

_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.

Does anyone knows how to fix the problem?

回答1:

Try write from Terminal:

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

Then log out and log in again.

Now Jenkins will run as agent and can access WindowServer.



回答2:

Make sure you have -nographics parameter among your startup parameters



回答3:

I had this same issue. The problem is with how Jenkins and Unity work individually. The only way I could find a cleaner work around was:

  1. Ideally have your Jenkins master only do assignments to slave and do not build anything by itself. So your slaves would build the project.
  2. In case above is not easily doable here is a quick workaround:
    • On your Jenkins master create a slave.
    • Add a label to execute your Unity project on the newly created slave.
    • Configure the job to run on dedicated slave that you created above.
    • All works now!


回答4:

It looks like you're missing the --projectPath option prior to specifying your project's path?



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!