Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Usage in batchmode

Discussion in 'Unity Accelerator' started by actislav, Jan 31, 2020.

  1. actislav

    actislav

    Joined:
    Mar 2, 2018
    Posts:
    8
    Is there any option to run unity in batchmode with command line to enable usage of new accelerator remote server? Something like "-CacheServerIPAddress <host:port>" for old one.
     
  2. bradunity

    bradunity

    Joined:
    Nov 12, 2013
    Posts:
    195
    Yes, there definitely is. I apologize that we have not updated our official documentation to reflect this (it's in progress). For the time being, here's the relevant info on using the Accelerator in an automated build system (CI/CD) or otherwise scripted fashion...

    Command line overrides
    In some cases, like CI, it will be useful to force certain cache server settings from scripts. For this, Unity supports these command line arguments.
    • -cacheServerEndpoint string
      • Set the endpoint address for the cache server. Example:
        • -cacheServerEndpoint 127.0.0.1:10080
    • -cacheServerNamespacePrefix string
      • Set the namespace prefix. Used to group data together on the cache server. Example:
        • -cacheServerNamespacePrefix MyProject
    • -cacheServerEnableDownload bool
      • Enable downloading from cache server. Example:
        • -cacheServerEnableDownload true
    • -cacheServerEnableUpload bool
      • Enable uploading to cache server.
        • -cacheServerEnableUpload false
    When using these command line arguments, the global or project specific equivalent setting ignored.

    Enabling Cache Server from the command line
    If cache server hasn’t been enabled from the settings (either global or project specific). Then it’s possible to use these command line switches to force enable cache server.

    -adb2 -enableCacheServer

    This will also ignore any settings that would disable it.
     
    Pawciu, r_at_pg, alexvector and 3 others like this.
  3. bradunity

    bradunity

    Joined:
    Nov 12, 2013
    Posts:
    195
    @alexvector uncovered a bug in 2019.3 regarding use of the -cacheServerNamespacePrefix, in that the editor will only use the value set in the Project Settings. It has been fixed in 2020.1 and the team is evaluating if it can be backported to 2019.3 (or possibly the 2019 LTS release).
     
    r_at_pg likes this.
  4. exjohan

    exjohan

    Joined:
    Feb 7, 2020
    Posts:
    1
    The 2019.4 docs says that -EnableCacheServer is the name of the command line argument, but that does not seem to work. Is that a documentation bug (should it not start with a capital E?)
     
    r_at_pg and Koji-Nakamaru like this.
  5. r_at_pg

    r_at_pg

    Joined:
    Feb 18, 2021
    Posts:
    2
    I tried -EnableCacheServer and -enableCacheServer and neither had any effect. I have no idea what -adb2 means, but that fixed the problem. So, my final command-line arguments list is:
    -adb2 -enableCacheServer -cacheServerEndpoint 127.0.0.1:10080 -cacheServerEnableDownload true -cacheServerEnableUpload false

    (That's not the real IP address I'm using, fyi.) I can verify that the assets are being downloaded from my Accelerator server with that command-line.
    I wasted a couple of hours on this, because of the poor documentation. bradunity's posts were super-useful; these posts should be integrated into the official documentation.