Reputation: 471
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?
Upvotes: 14
Views: 19073
Reputation: 97008
You also get this error if the user you are running as is not currently logged in graphically.
Upvotes: 0
Reputation: 11
I tried
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
sudo mv /Library/LaunchDaemons/org.jenkins-ci.plist /Library/LaunchAgents/org.jenkins-ci.plist
Then Restarted my Mac
And then sudo launchctl load /Library/LaunchAgents/org.jenkins-ci.plist
after restarting
It worked
Upvotes: 1
Reputation: 41
Make sure you have -nographics parameter among your startup parameters
Upvotes: 4
Reputation: 1
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:
Upvotes: 0
Reputation: 1940
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.
Upvotes: 13
Reputation: 787
It looks like you're missing the --projectPath option prior to specifying your project's path?
Upvotes: -1