Search Unity

Deploying Packages through command line?

Discussion in 'Package Manager' started by darenkilley, Jun 5, 2019.

  1. darenkilley


    Jun 5, 2019

    To be honest I am not even sure this is the best area to post this but seemed relevant so I thought I would see if anyone here could help. To keep it short I work for a school that has a 'gaming development' class in which they use Unity. I have received a request from that Teacher asking if a package specifically..


    Could be added to the entire lab's Unity installation as a resource for them to work with. For most small installations like this I would just script something basic to deploy it but after looking around the forums the best I came up with was this...

    "C:\Program Files (x86)\Unity\Editor\Unity.exe" -importPackage "\\XXX-Server\XXXXX\UnityPackages\MoonLander\moon-lander-package.unitypackage"

    And to be blunt it doesn't seem to do a darn thing haha so either I am missing something or barking up the wrong tree completely.

    So I am here asking... is it possible to deploy unitypackages via command line and/or basic script to a large number of computers or am I just out of luck?

    Thank you to anyone who takes a moment to help me out with this issue.
  2. ethan_jl_unity


    Unity Technologies

    Sep 27, 2018
    Hey there,

    I'm not sure if such command line argument exists but maybe you could achieve what you need by adding a C# script in the project that will be executed on editor launch.

    You could import the package through C# by calling `importPackage` in the start up script.

    I'm not sure how the import code will work on a package that's on a server, so you'll have to try it out and see.

    Let me know how it goes!
  3. darenkilley


    Jun 5, 2019
    Thank you so much for the quick response... I am looking into what you advised but in the meantime would you have any other recommendations in terms of perhaps a better way to do a 'mass deployment' ? I mean I cannot believe we are the first educational site to have to provide a number of students with similar resources haha.
  4. Adrian


    Apr 5, 2008
    Packages aren't part of the Unity installation, they can only be part of a project. Unity used to bundle some packages that would show up in the «Import Package» menu but they have moved away from that. There are no globally installed or selectable packages in recent Unity versions.

    Is see two ways deploying a package could work:

    1. Just copy the package to the computers at a specific location. The students then have to import the package from that location when they need it in their projects.

    2. Create a Unity project and import the package. Then deploy this project as a starter project students can use.

    Unity is experimenting with project templates but you cannot create custom ones yet. In the future, another option would be to deploy such a template that includes the package.