使用Jenkins构建Unity项目失败

时间:2022-09-06 07:33:39

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

我正在尝试在Mac OS Server上与Jenkins一起构建Unity项目。但是当我尝试运行以下脚本时

/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.

_RegisterApplication(),FAILED建立与WindowServer的默认连接,_CGSDefaultConnection()为NULL。

Does anyone knows how to fix the problem?

有谁知道如何解决这个问题?

4 个解决方案

#1


13  

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.

现在Jenkins将作为代理运行并可以访问WindowServer。

#2


4  

Make sure you have -nographics parameter among your startup parameters

确保启动参数中包含-nographics参数

#3


0  

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:

我有同样的问题。问题在于Jenkins和Unity如何单独工作。我找到更清洁工作的唯一方法是:

  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. 理想情况下,你的Jenkins大师只能对奴隶进行任务,而不是自己构建任何东西。所以你的奴隶会建立这个项目。
  3. 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.
    • 添加标签以在新创建的从站上执行Unity项目。
    • Configure the job to run on dedicated slave that you created above.
    • 将作业配置为在上面创建的专用从站上运行。
    • All works now!
    • 一切都行了!
  4. 如果上面不容易做到这里是一个快速的解决方法:在你的Jenkins主人创建一个奴隶。添加标签以在新创建的从站上执行Unity项目。将作业配置为在上面创建的专用从站上运行。一切都行了!

#4


-1  

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

在指定项目的路径之前,您似乎缺少--projectPath选项?

#1


13  

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.

现在Jenkins将作为代理运行并可以访问WindowServer。

#2


4  

Make sure you have -nographics parameter among your startup parameters

确保启动参数中包含-nographics参数

#3


0  

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:

我有同样的问题。问题在于Jenkins和Unity如何单独工作。我找到更清洁工作的唯一方法是:

  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. 理想情况下,你的Jenkins大师只能对奴隶进行任务,而不是自己构建任何东西。所以你的奴隶会建立这个项目。
  3. 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.
    • 添加标签以在新创建的从站上执行Unity项目。
    • Configure the job to run on dedicated slave that you created above.
    • 将作业配置为在上面创建的专用从站上运行。
    • All works now!
    • 一切都行了!
  4. 如果上面不容易做到这里是一个快速的解决方法:在你的Jenkins主人创建一个奴隶。添加标签以在新创建的从站上执行Unity项目。将作业配置为在上面创建的专用从站上运行。一切都行了!

#4


-1  

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

在指定项目的路径之前,您似乎缺少--projectPath选项?