Search Unity

Magic Leap Command Line usage

Discussion in 'Magic Leap' started by ShawnFiore, Sep 25, 2018.

  1. ShawnFiore

    ShawnFiore

    Joined:
    Aug 22, 2018
    Posts:
    3
    I'm trying to build a Lumin OS project through the Unity command line interface. I'm trying to find the equivalent usage of the existing Unity commands. for example "-buildWindowsPlayer", so I would imagine it would look something like this below.

    -quit -batchmode -projectPath "$WORKSPACE/UnityProject" -buildLuminPlayer "$WORKSPACE/UnityProject\Build\MagicLeap\MagicLeap.mpk" -buildtarget Lumin -logFile "$WORKSPACE/UnityProject\unity3d_editor.log"
     
    renoufa likes this.
  2. StuartRiffleUnity

    StuartRiffleUnity

    Unity Technologies

    Joined:
    May 4, 2017
    Posts:
    10
    This is not supported yet, but I have added a ticket for it
     
  3. ShawnFiore

    ShawnFiore

    Joined:
    Aug 22, 2018
    Posts:
    3
    Okay, thank you for the response. I started writing a custom c# class that I'll just call through the command line with executeMethod command. Hopefully, I can accomplish what I need that way.
     
  4. DenverIW

    DenverIW

    Joined:
    May 27, 2018
    Posts:
    3
    @StuartRiffleUnity any status update on this ticket? We are not seeing the functionality in any recent releases.
     
  5. renoufa

    renoufa

    Joined:
    Apr 9, 2019
    Posts:
    6
    Any update on this, im trying to build a ML project as part of a CI/CD pipeline and could do with this option
     
  6. renoufa

    renoufa

    Joined:
    Apr 9, 2019
    Posts:
    6
  7. Stephen-Hodgson

    Stephen-Hodgson

    Joined:
    Jul 15, 2014
    Posts:
    23
    I'd also like to now if this is now availible now that 2019 has been released with official Lumin support
     
  8. renoufa

    renoufa

    Joined:
    Apr 9, 2019
    Posts:
    6
    Still no update?
     
  9. Stephen-Hodgson

    Stephen-Hodgson

    Joined:
    Jul 15, 2014
    Posts:
    23
    It works
     
  10. renoufa

    renoufa

    Joined:
    Apr 9, 2019
    Posts:
    6
    Any other info on this, what version and how?
     
  11. Stephen-Hodgson

    Stephen-Hodgson

    Joined:
    Jul 15, 2014
    Posts:
    23
    2019.1+

    Pretty much how it was written above.
     
  12. vMattC

    vMattC

    Joined:
    May 30, 2019
    Posts:
    2
    Hey @Stephen-Hodgson I'm testing 2019.1.4 and it doesn't look like the command line option -buildLuminPlayer is supported. You have this working?

    Looking at the unity.exe via ProcessExplorer (Properties > Strings) I see all the command line options such as -buildWindowsPlayer etc, but nothing for Lumin. Certainly doesn't mean its not supported, but I would expect to see the buildLuminPlayer string there.

    In command line test the option -buildLuminPlayer is ignored or at least not acted upon.

    "C:\Program Files\Unity\Hub\Editor\2019.1.4f1\Editor\Unity.exe" -projectPath D:\Source\ar-app -logFile D:\Source\ar-app\Logs\ARApp-logs.txt -buildTarget Lumin -buildLuminPlayer D:\Source\ar-app\ARApp.mpk -stackTraceLogType Full -batchmode -quit


    Anyway, my solution today is create a script (with a class called BuildPlayerLumin and a method called MyBuild) that performs the build from within the editor. That MyBuild method can be called from the command line using -executeMethod.

    "C:\Program Files\Unity\Hub\Editor\2019.1.4f1\Editor\Unity.exe" -projectPath D:\Source\ar-app -logFile D:\Source\ar-app\Logs\ARApp-logs.txt -executeMethod BuildPlayerLumin.MyBuild -stackTraceLogType Full -batchmode -quit
     
    Last edited: Jun 3, 2019
    renoufa likes this.
  13. Stephen-Hodgson

    Stephen-Hodgson

    Joined:
    Jul 15, 2014
    Posts:
    23
  14. vMattC

    vMattC

    Joined:
    May 30, 2019
    Posts:
    2
    Ok sorry, i'm a little confused, are you running Unity.exe from the command line and creating a build using batchmode? If so, when using -buildTarget Lumin how are you specifying the mpk file? -buildLuminPlayer option does not work so there is no other mechansim to specify your player/mpk... Unless you are calling a script within the editor to run the build process (like I am in the example above).
     
  15. renoufa

    renoufa

    Joined:
    Apr 9, 2019
    Posts:
    6
    Looks like the above script is using the Unity Installer to install unity and the luminOS supported packages, this is not what this thread is about, this thread is about using the unity.exe installed version to build a magic leap mpk.
     
  16. Stephen-Hodgson

    Stephen-Hodgson

    Joined:
    Jul 15, 2014
    Posts:
    23
    Sure it is. That powershell script essentially calls on all the same cmd line args that would typically be used.
    I'm currently using this for my CI/CD pipeline with ML to create a mpk package