Choose your operating system:
Windows
macOS
Linux
AutomationTool is a host program and a set of utility libraries you can use to script unattended processes related to Unreal Engine when using C#. Internally, we use AutomationTool for a variety of tasks, including building, cooking, and running games, running automation tests, and scripting other operations to be executed on our build farm.
The source code for AutomationTool, and various scripts that run under it, can be found under
Engine/Source/Programs/AutomationTool
.
While we provide this tool as a courtesy, the level of support we can provide is limited.
How AutomationTool Works
Automation Projects
When run, AutomationTool finds all automation projects (saved as Visual Studio C# projects with an
.Automation.csproj
extension), compiles them, and then uses reflection to find the appropriate command to be executed. Those commands are implemented as classes derived from the
BuildCommand
base class, and are identified by the class name.
To learn more, read how to add an automation project and how to add a command .
Running AutomationTool
You can run commands under the Visual Studio debugger on Windows, or from the command line on Windows, Mac, and Linux.
Running Commands under the Debugger
To run AutomationTool under the Debugger in Visual Studio:
-
Right click the AutomationTool Project, and select Properties from the context menu.
-
Select the Debug tab, and enter your command name (here, we use
SampleCommand
) into the Start Options > Command line arguments: field. -
Set a breakpoint in your script before pressing the F5 key (or clicking the Start button in the Visual Studio toolbar).
Running Commands from the command line (Windows)
To run AutomationTool from the command line:
-
Open a Command Prompt window.
-
Change the working directory to
Engine/Build/BatchFiles
. -
Enter the following into the command line:
RunUAT.bat SampleCommand
Running Commands from the terminal (Mac/Linux)
To run AutomationTool from the terminal:
-
Open the terminal.
-
Change the working directory to
Engine/Build/BatchFiles
. -
Enter the following into the command line:
./RunUAT.sh SampleCommand
Command Line Syntax
The general syntax of the AutomationTool command line is:
RunUAT.bat Command1 [-Arg1 -Arg2...] Command2 [-Arg3 -Arg4…] ...
Here, two commands will be run sequentially.
-Arg1
and
-Arg2
are passed to
Command1
, and
-Arg3
and
-Arg4
are passed to
Command2
.
Global options:
Option |
Description |
---|---|
|
Shows help and options for AutomationTool in general, or (when specified after a command name) help for that particular command. |
|
Displays a list of all available AutomationTool commands. |
|
Enable Perforce support. |
|
Allows automated processes to submit files. |
|
Prevents AutomationTool from compiling any
|
If set, the following environment variables are used to configure Perforce support for build machines. They may be set via the AutomationTool command line in the
VARNAME=VALUE
syntax or inherited from the current session.
Environment Variable |
Description |
---|---|
|
The Perforce server and port (for example,
|
|
Path to the local root directory of the current client (for example,
|
|
The current changelist that is synced to. |
|
|
|
The Perforce user. |
|
Name of the client used to access Perforce. |
|
Path to the root of the current branch or stream (for example,
|