1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Are you an artist or level designer going to Unite Europe? Join our roundtables there to discuss artist features.
    Dismiss Notice
  6. Unity 5.6 is now released.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice

How to enable headless mode on Unity Could Build?

Discussion in 'Unity Cloud Build' started by desertkun, Mar 11, 2016.

  1. desertkun

    desertkun

    Joined:
    Jan 13, 2016
    Posts:
    8
    Hello!

    I am trying build a game server for Linux using Could Build, but to achieve that I need "headless mode" option to be enabled. It's mandatory to run the build on my Debian machine.

    [​IMG]

    But there's no such option in "Advanced options" section at project's page in Unity Could Build. There's a "Pre-Export Method Name" option, though, but I don't know how to enabled headless mode using it:

    Code (CSharp):
    1. public class CloudBuild
    2. {
    3.     public static void BeforeBuild()
    4.     {
    5.         ??? BuildOptions.EnableHeadlessMode
    6.     }
    7. }
    How can I achieve that? Thank you.
     
  2. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    76
  3. desertkun

    desertkun

    Joined:
    Jan 13, 2016
    Posts:
    8
    Thank you very much!
     
  4. desertkun

    desertkun

    Joined:
    Jan 13, 2016
    Posts:
    8
    Unfortunately, with this code does not work:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3.  
    4. public class CloudBuild: MonoBehaviour
    5. {
    6.     public static void BeforeBuild()
    7.     {
    8.         EditorUserBuildSettings.enableHeadlessMode = true;
    9.     }
    10. }
    11.  
    What am I doing wrong? I've put this script into "Assets/Editor" folder, and set "CloudBuild.BeforeBuild" as a "Pre-Build Script", but the resulting build is 100% identical with the one without such option. Also, I can attach the full build log.

    UPD. So, apparently, with this option enabled I cannot get the build with headless mode. I've added a Debug.Log line to check if it gets executed, and it does.

    I believe I should pass the BuildOptions.EnableHeadlessMode option somewhere somehow. How can I access the building pipeline then?

    Any suggestions? Thank you!
     
    Last edited: Mar 13, 2016
  5. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    76
    The BuildOptions.EnableHeadlessMode enum is passed into the final call to the BuildPipeline.BuildPlayer function if you are doing a build directly. We ultimately run that in Unity cloud build, let me check on our usage of the BuildOptions and EditorUserBuildSettings.enableHeadlessMode and get back to you.
     
  6. desertkun

    desertkun

    Joined:
    Jan 13, 2016
    Posts:
    8
    Thank you for the response, would appreciate it.
     
  7. desertkun

    desertkun

    Joined:
    Jan 13, 2016
    Posts:
    8
    Any news on this?
     
  8. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    76
    Sorry about the delay in getting back to you. We only support a subset of the BuildOptions enum in cloud build and headless mode is not one of those options currently. I've been discussing options with the team about expanding those options and how best to handle it but nothing concrete just yet.
     
  9. desertkun

    desertkun

    Joined:
    Jan 13, 2016
    Posts:
    8
    Sorry for disturbing, but is there any update on this?
     
  10. ed-altorfer

    ed-altorfer

    Joined:
    Apr 7, 2013
    Posts:
    3
    I'm also looking for a solution to the same problem. The server part of my game needs to run headless and I currently have no way of making these builds other than doing it manually.
     
  11. darthbator

    darthbator

    Joined:
    Jan 21, 2012
    Posts:
    122
    I am also looking for this support. Unless there's plans to get that unet server .dll out there fairly quickly I need to imagine headless linux builds are only going to become more common.
     
  12. Miiirage

    Miiirage

    Joined:
    May 13, 2016
    Posts:
    8
    @Ryanc_unity What is the status of this now? We're also exploring to incorporate Unity Cloud build in our company, but this is a must-have feature in order to pass.
     
  13. ParallelPlaidJoel

    ParallelPlaidJoel

    Joined:
    Nov 23, 2016
    Posts:
    1
    Has anyone figured this out?
     
  14. MrMike-ArtCraft

    MrMike-ArtCraft

    Joined:
    Jul 22, 2013
    Posts:
    1
    Bump. Just ran into this on my project too. I've written a bug to track this problem: (Case 872169)
     
    Last edited: Jan 19, 2017
  15. Soulbadger

    Soulbadger

    Joined:
    Jan 3, 2014
    Posts:
    2
    Another nudge, any news, I currently have one server component that I have to build manually because of this, everything else is beautifully CI
     
  16. RJS

    RJS

    Joined:
    Jun 27, 2013
    Posts:
    2