Build Unity project with Jenkins failed

后端 未结 6 974
[愿得一人]
[愿得一人] 2021-02-05 13:40

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 -         


        
相关标签:
6条回答
  • 2021-02-05 14:15

    You also get this error if the user you are running as is not currently logged in graphically.

    0 讨论(0)
  • 2021-02-05 14:19

    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.

    0 讨论(0)
  • 2021-02-05 14:22

    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!
    0 讨论(0)
  • 2021-02-05 14:27

    Make sure you have -nographics parameter among your startup parameters

    0 讨论(0)
  • 2021-02-05 14:37

    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

    0 讨论(0)
  • 2021-02-05 14:38

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

    0 讨论(0)
提交回复
热议问题