Build Unity project with Jenkins failed

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,

  • Android+Eclipse project sharing via SVN?
  • Using git with android source repository retrieved with repo
  • How to reset to any of the previous commit in android studio?
  • How to enable Version Control window in android studio
  • Embed git-describe, date and time in a build during compilation in eclipse
  • Try to add library to gradle
  • _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.

    Does anyone knows how to fix the problem?

  • Jenkins service unavailable error - 503 - running as different user
  • How to configure a single Jenkins job to make the release process from trunk or branches?
  • can we use tunnelling in jenkins before connecting to the svn repository?
  • How to configure Maven installation in Jenkins per individual Slave node?
  • How can you access an environment variable that has a space in its name in bash?
  • iOS tests will not run on simulator when using Jenkins through JNLP
  • 4 Solutions collect form web for “Build Unity project with Jenkins failed”

    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.

    Make sure you have -nographics parameter among your startup parameters

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

    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!
    Git Baby is a git and github fan, let's start git clone.