Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Suggestion: The command line and Unity Hub

Discussion in 'Unity Hub' started by ikriz, Mar 16, 2018.

  1. ikriz

    ikriz

    Joined:
    Dec 3, 2009
    Posts:
    85
    It would be a nice addition to be able to do the following:
    • Start Unity Hub from the command line pass it a unity project and it automatically initialises the correct unity version. possibly passing command line options on to the unity executable. This would make build automation and unity version management a darn sight easier.
    • Tell hub to download/install/remove the latest/specific version through the cmdline, automate the world :)
    Would love to see these options added
     
    Rock360, De-Panther, Deozaan and 2 others like this.
  2. mathieub

    mathieub

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    25
    Hi @ikriz,

    Thanks for your suggestion.
    Looks like having a CLI for the Hub is something which comes back quite a few times now.

    We will discuss it and evaluate this feature to see where it could fit in the the current Hub's roadmap.
     
  3. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    221
    Upvote for Hub CLI. It could be a great build tool.
     
  4. EduardDraude

    EduardDraude

    Joined:
    May 3, 2017
    Posts:
    8
    Up! We need this.
     
  5. IWJared

    IWJared

    Joined:
    Mar 20, 2014
    Posts:
    1
    This is a fantastic idea, and would make our automated testing process so much easier.
     
  6. jamiebrynes

    jamiebrynes

    Joined:
    Sep 12, 2017
    Posts:
    12
    Upvoting too! Would be immensely useful for automated builds!
     
  7. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    531
    Yes - we use Ansible right now for managing fleets of Jenkins build agents for Unity games. We do a lot of dorking around with .pkg files to get the right Unity versions on those machines. The hub could make that far simpler.
     
  8. Tobiah

    Tobiah

    Joined:
    Oct 29, 2013
    Posts:
    3
    +1 to this! Would be super useful for a lot of automated build pipelines
     
  9. Fleer_CTC

    Fleer_CTC

    Joined:
    Jun 15, 2017
    Posts:
    1
    +1 This would be amazing!
     
  10. KevinKeyserHats

    KevinKeyserHats

    Joined:
    Feb 9, 2017
    Posts:
    4
    +1 would make my life easier in the long run
     
  11. nih_

    nih_

    Joined:
    Aug 7, 2017
    Posts:
    2
  12. halilkayim

    halilkayim

    Joined:
    Feb 27, 2018
    Posts:
    16
    This would make it so much easier for us during our CI and release builds. +1
     
  13. Rock360

    Rock360

    Joined:
    Oct 26, 2016
    Posts:
    3
  14. mihakinova

    mihakinova

    Joined:
    Jan 6, 2015
    Posts:
    85
    +1 this is a MUST!
     
  15. BossKey

    BossKey

    Joined:
    May 3, 2013
    Posts:
    2
    In addition the commands mentioned above, we need the ability to license Unity via the command line. We manage close to 200 seats in an educational environment and are currently able to update our license keys via the command line. Unity Hub does not offer this ability. Worse yet, when Unity is installed via Hub, it no longer allows activation via the command line. This is even further exacerbated by the fact that Hub returns with a licensing server error 9 out of 10 times and just seems to never work on certain machines. See https://forum.unity.com/threads/lic...or-please-contact-support-unity3d-com.527145/
     
  16. DylanYasen

    DylanYasen

    Joined:
    Oct 9, 2013
    Posts:
    49
  17. pnaidu

    pnaidu

    Joined:
    Jan 5, 2018
    Posts:
    9
  18. jhofizinser

    jhofizinser

    Joined:
    Nov 3, 2016
    Posts:
    1
    +1 as well. Great for CI but might make git bisect workable with editor changes
     
  19. mdswanson

    mdswanson

    Joined:
    Apr 11, 2016
    Posts:
    1
    +1 from me too.
     
  20. Ratatoeskr

    Ratatoeskr

    Joined:
    Oct 25, 2013
    Posts:
    5
    +1000 from me! :p
     
  21. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    221
    Really need this now that there doesn't seem to be any other way to get the latest Linux builds.
     
  22. jonathan_blank

    jonathan_blank

    Joined:
    Apr 13, 2018
    Posts:
    1
    PLS PLS PLS,
    we need this for professional workflows
     
  23. nilsubimax

    nilsubimax

    Joined:
    Apr 3, 2017
    Posts:
    15
  24. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    221
    Digging through the Hub logs (in .config on linux and [UserAppDataFolder]\Roaming on Windows) yielded something useful:

    https://public-cdn.cloud.unity3d.com/hub/prod/releases-linux.json
    and
    https://public-cdn.cloud.unity3d.com/hub/prod/releases-win32.json

    Hub tries to refresh this, so I downloaded the linux releases. It contains the paths for all the binary downloads, which all seem to be archives inside archives with pretty predictable names. The Windows downloads are the same old executable component installers, so probably automatable on the CLI. The linux archives are just the actual binaries, so they'd need to be extracted to the appropriate locations and probably have the programs marked as executable. If/when I get this working, I'll update my dockerfiles and finally get new images (https://hub.docker.com/u/angusmf/) out for the missing 2018.2 releases.

    ---edit---

    I've hit a dead end with the .pkg files. Can open them, but not parse them. Dropping it here and hoping we get some other way to do this stuff.
     
    Last edited: Oct 7, 2018
  25. mikael_kalms

    mikael_kalms

    Joined:
    Mar 16, 2017
    Posts:
    5
    +1 on this.

    Unity Hub has the potential to serve as the one-stop-shop for performing automated license management and download/installation of Unity. To reach that point, the following changes / features would be necessary:

    1. A way to activate/deactivate a Unity license from the command line. This is needed in unattended scenarios (build systems). This can currently be done by installing a Unity Editor and calling that with specific command line switches to perform license management -- but it would be convenient to have the much smaller Unity Hub capable of doing this.

    2. A way to install/uninstall a specific Unity version from the command line, with a specific list of components.

    3. A way to install non-latest patch/fix releases. This is needed in environments where stability & reproducibility is important. For large teams, and for build systems of any size, rollout of new patch/fix versions should be managed centrally. As long as Unity Hub only offers the latest patch/fix release for a given major.minor version, I consider a non-Hub installation flow preferable in those scenarios.

    (Since people have logged in with their Unity IDs when they use Unity Hub, the application could, in theory, also enumerate / download / install console-specific packages for those that are licensed. I understand that this would require use of other APIs than public-cdn.cloud.unity3d.com, and may cause backend scaling problems - but it could be something worth considering for the long term.)

    ---

    Our automation (available here) downloads & runs Unity installation packages manually. We have resorted to manually collect & maintain a small index of download URLs here.
     
  26. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    221
    Wow, those are some hoops to jump through. This is really frustrating. I've been writing code of some sort or another for over 30 years. That's about how long there's been a computer at home. Of that, about 20 of it has been spent building (as in builds) and deploying (as in creating installs/packages and automating their delivery) software professionally, mostly for Windows. Why the difference in numbers? Because until you go work for somebody with funding, you have NO ACCESS TO REAL TOOLS. There's a huge difference in the kind of software you can create, even as a student or hobbyist when you have access to the tools that professionals are utterly reliant on. Unfortunately with Unity, I don't see any real tools available, hobbyist or not. To be forced to do all that work and still be tied to a single license running on a live Windows Jenkins agent? Madness!! I feel like I'm being pushed backwards in time...
     
    Last edited: Oct 9, 2018
  27. mikael_kalms

    mikael_kalms

    Joined:
    Mar 16, 2017
    Posts:
    5
    Someone in the community has put in the effort to automate discovery and installation of Unity versions: Check out https://github.com/DragonBox/u3d - it looks like it solves most of the problem until the day Unity builds an official solution. From what I can tell, u3d does not do license management, nor discover/install console packages.

    (u3d is a combination of a web scraper that locates unity versions / download links, an index JSON with the results on GitHub pages, and then a commandline utility for downloading/installing Unity versions.)

    Agreed. I ask our Unity business contact for info on "build machine licenses" every couple of months. Nothing concrete has materialized so far though.
     
    angusmf likes this.
  28. akiojin

    akiojin

    Joined:
    Nov 1, 2012
    Posts:
    1