Adding components to the Unity Editor
Installing Unity offline without the Hub

Installing Unity from the command line

If you want to automate the deployment of Unity in an organization, you can install the Editor and other components from the command line. The components are normal installer executable programs and packages which you can use to automate the deployment of Unity.

To download the components, you use the Unity installer to download the Unity components to a folder on your computer.

  1. Download and run the installer. Release versions of the installer are available from the the Unity download archive. For Prerelease versions of the installer, see the Beta programs page.

  2. In Choose Components, select all of the components for which you are automating deployment.

  3. In Choose Download and Install locations, click the Download to radio button.

  4. Enter a location in which to store the component installers.

  5. Finish the install.

Navigate to the download location you specified. In the folder, you will find the installer files for the components you selected and a script file (install.bat on Windows or install.sh on Linux or OS X) that you can run to install the components.

Downloaded installers on Windows
Downloaded installers on Windows

To install Unity on another computer using the downloaded components, copy the contents of the folder to the destination computer and execute the install script.

Installing individual Unity components on Windows from the command line

从 Windows 上的命令行安装 Editor 和其他组件时,请使用以下选项。

注意:安装程序命令行参数区分大小写。

Unity Editor install

命令 详细信息
/S 执行静默(不提出问题)安装。
/D=PATH Sets the default install directory. Useful when combined with the silent install option. The default folder is C:\Program Files (x86)\Unity (32-bit) or C:\Program Files\Unity (64-bit).

示例

UnitySetup64.exe /S /D=E:\Development\Unity

This example installs Unity silently to a E:\Development\Unity folder, which will be the root of the Unity installation. In this case, the Editor executable is installed in E:\Development\Unity\Editor\Unity.exe. The default install directory must be the last argument on the command line. The supplied path must not be surrounded by quotes, even if the path contains spaces.

Unity Editor uninstall

要执行静默卸载,请从命令行或脚本中运行 Uninstall.exe /S

Note: Although the process finishes right away, there is a delay before the files are actually removed. This is because the uninstaller is copied to a temporary location to enable it to remove itself. Make sure that the working directory is not inside the Unity install location. If it is, the uninstaller will be unable to remove the folder.

Standard Assets install

要静默安装标准资源,请执行以下命令:

UnityStandardAssetsSetup.exe /S /D=E:\Development\Unity

Note: If specifying a folder, use the Unity root folder (that is, the folder containing the Editor folder, and not the folder in which Unity.exe is installed.)

Example Project install

要静默安装示例项目,请使用:

UnityExampleProjectSetup.exe /S /D=E:\Development\Unity

注意:默认文件夹是 C:\Users\Public\Documentation\Unity Projects\Standard Assets Example Project

Installing Unity on OS X from the command line

各 Unity 安装程序均以 .pkg 文件形式提供,可以使用 installer 命令来进行安装,如下所述。

Unity Editor install

要将 Editor 安装到指定目标卷上的 /Applications/Unity 文件夹中,请输入:

sudo installer [-dumplog] -package Unity.pkg -target /

Standard Assets install

要将标准资源安装到指定卷上的 /Applications/Unity/Standard Assets 文件夹中,请输入:

sudo installer [-dumplog] -package StandardAssets.pkg -target /

Example Project install

要将示例项目安装到指定卷上的 /Users/Shared/Unity/Standard-Assets 文件夹中,请输入:

sudo installer [-dumplog] -package Examples.pkg -target /

Torrent 下载

如果希望通过 BitTorrent 客户端下载 Unity,可从 Unity 下载存档页面获取 Torrent 链接。并非所有版本都支持 Torrent 下载。如果某个版本能以 torrent 方式下载,__Downloads__ 下拉菜单中将显示 Torrent download (Win+Mac) 选项。

使用 Torrent 来下载 Unity
使用 Torrent 来下载 Unity

一次安装多个版本

You can install multiple versions of Unity on the same computer.

On a Mac, the installer creates a folder called Unity, and overwrites any existing folder with this name. To install more than one version of Unity on your Mac, rename the existing Unity folder before installing another version.

在 PC 上,将安装文件夹始终命名为 Unity X.Y.Z[fp]W__,其中 f__ 表示正式版,而 p 用于标记补丁版本。

We strongly recommend that if you rename a Unity folder, you name the new folder logically (for example, add the version number to the end of the name). Any existing shortcuts, aliases and links to the offline docs might no longer point to the old version of Unity. This can be particularly confusing with the offline docs; if you suddenly find that browser bookmarks to the offline docs no longer work, then check that they have the right folder name in the URL.


  • 2018–12–19 Page amended with editorial review
  • 2018–06–12 Page amended with editorial review
  • 在 Unity 2017.2 版中更新了安装建议
  • 在 Unity 2017.4 版中更新了安装建议
Adding components to the Unity Editor
Installing Unity offline without the Hub