Overview
Introduction to ue4cli
Contents
Overview
The ue4cli Python package implements a command-line tool called ue4
that provides a simplified interface to various functionality of the build system for Epic Games’ Unreal Engine 4. The primary goals of this tool are as follows:
- Abstract away the platform-specific details of the various batch files and shell scripts scattered throughout the Engine’s source tree.
- Provide the ability to easily generate IDE project files under Linux, where no shell integration currently exists to perform this task from outside the Editor.
- Determine the compiler flags required to build third-party libraries for use within Engine modules. This is particularly important under macOS and Linux where symbol interposition can cause clashes between external libraries and those bundled in the
ThirdParty
directory of the Engine source tree, and under Linux where libraries need to build against the Engine’s bundled version of libc++.
Installation
ue4cli requires Python 3.5 or newer, and works as an interface to Unreal Engine 4.19.0 or newer.
To install ue4cli, simply run:
Under macOS, the old version of Mono that comes bundled with the Unreal Engine breaks when compiling .NET projects that have spaces in their paths, so you will need to install the latest version of Mono using Homebrew:
Unreal Engine location auto-detection
Auto-detection is most useful when you are only working with a single version of the Unreal Engine and it is installed in the default location. If you have multiple Engine installations and want to control which version is used, or are working with installations in non-default locations (such as source builds of the Engine), then you should explicitly specify a path override using the ue4 setroot command.
Windows
The default installation directory used by the Epic Games Launcher is searched for the newest installed version:
macOS
The default installation directory used by the Epic Games Launcher is searched for the newest installed version:
Linux
Under Debian-based distributions, the Engine’s shell integration is utilised to locate the root directory, by parsing the shortcut file:
If this file doesn’t exist, then the command UE4Editor
needs to be in the system PATH.
List of commands
Configuration Commands
These commands control the configuration of ue4cli itself.
Clears any cached data that ue4cli has stored.
Removes any previously-specified Engine root path override.
Sets an Engine root path override that supersedes auto-detection.
Engine Commands
These commands relate to the currently detected or configured installation of the Unreal Engine.
Build the specified target using UBT.
Runs the editor without an Unreal project (useful for creating new projects).
Prints the path to the root directory of the Unreal Engine installation.
Prints the version string of the Unreal Engine installation.
Descriptor Commands
These commands relate to an individual Unreal project or plugin, and will look for a .uproject
or .uplugin
file located in the current working directory. (Note that some commands only support projects, not plugins.)
Builds the Editor modules for the Unreal project or plugin.
Cleans build artifacts for the Unreal project or plugin.
Generates IDE project files for the Unreal project.
Packages a build of the Unreal project or plugin in the current directory.
Runs the Editor for the Unreal project.
Runs automation tests for the Unreal project.
Library Commands
These commands are for developers compiling modules that need to build against UE4-bundled third-party libraries for purposes of interoperability with the Engine.
Prints the CMake flags for building against the specified libraries.
Prints the compiler flags for building against the specified libraries.
Prints the preprocessor definitions for the specified libraries.
Prints the header include directories for the specified libraries.
Prints the linker flags for building against the specified libraries.
Prints the library files for the specified libraries.
Lists the third-party libraries bundled with the Unreal Engine installation.
Automation Commands
These commands relate to Unreal’s automation system. Unless explicitly specified, the platform and project file path arguments will be automatically generated when invoking RunUAT.
Invokes RunUAT with the specified arguments.