UE4 Automation Tool

1 minute read.

Un­re­al En­gine Au­to­ma­tion Tool is your as­sis­tant for run­ning tests and con­trol­ling all au­to­ma­tion, e.g. on con­tin­u­ous in­te­gra­tion, au­to­mat­ed builds or just for your lo­cal test­ing.

Lo­ca­tion

Find the Un­re­al Au­to­ma­tion Tool in Engine\Build\BatchFiles\RunUAT.bat or Engine\Build\BatchFiles\RunUAT.sh.

Over­view

To get an over­view use -list while in­vok­ing RunUAT.bat. Make sure to use this on the automation sub­com­mand:

RunUAT -game -buildmachine -stdout -fullstdoutlogoutput -forcelogflush -unattended -nopause -nullrhi -nosplash \
  -ExecCmds="automation -list; quit"

This prints a list of all found au­to­ma­tion com­mands, which in my case is the fol­low­ing for ex­am­ple:

(skip list)

Running AutomationTool...
Parsing command line: -list

Available commands:
  AnalyzeThirdPartyLibs
  BlameKeyword
  BuildCommonTools
  ZipProjectUp
  BuildCookRun
  BuildDerivedDataCache
  BuildPhysX
  BuildPlugin
  BuildThirdPartyLibs
  CheckCsprojDotNetVersion
  CodeSurgery
  CopySharedCookedBuild
  CopyUAT
  ExtractPaks
  FixupRedirects
  GenerateDSYM
  ListThirdPartySoftware
  RecordPerformance
  ReplaceAssetsUsingManifest
  IPhonePackager
  Localize
  Localise
  MegaXGE
  SubmitUtilizationReportToEC
  TestP4_Info
  GitPullRequest
  TestFail
  TestSuccess
  TestMessage
  TestRecursion
  TestRecursionAuto
  TestMacZip
  TestP4_CreateChangelist
  TestP4_StrandCheckout
  TestP4_LabelDescription
  TestP4_ClientOps
  CleanDDC
  TestTestFarm
  TestArguments
  TestCombinePaths
  TestFileUtility
  TestLog
  TestChangeFileType
  TestGamePerf
  TestUATBuildProducts
  TestOSSCommands
  UBT
  SyncSource
  GenerateAutomationProject
  DumpBranch
  DebugSleep
  TestMcpConfigs
  TestBlame
  TestChanges
  TestKillAll
  TestCleanFormalBuilds
  TestStopProcess
  LookForOverlappingBuildProducts
  TestThreadedCopyFiles
  UpdateLocalVersion
  ZipUtils
  RebuildHLOD
  RebuildLightMaps
  ResavePackages
  ListMobileDevices
  StashTarget
  UnstashTarget
  BuildForUGS
  CheckBalancedMacros
  CheckForHacks
  CheckRestrictedFolders
  CheckTargetExists
  CheckXcodeVersion
  CleanAutomationReports
  CleanFormalBuilds
  CryptoKeys
  RebasePublicIncludePaths
  FinalizeInstalledBuild
  ResavePluginDescriptors
  ResaveProjectDescriptors
  RunP4Reconcile
  SyncDDC
  SyncDepotPath
  UE4BuildUtilDummyBuildCommand
  BuildGraph
  Build
  TempStorageTests
  CleanTempStorage
  TestGauntlet
  RunUnreal
  CleanDevices
  RunEngineTests
  RunEditorTests
AutomationTool exiting with ExitCode=0 (Success)

Get Help

To find out more about a com­mand, use -help, e.g.:

RunUAT -game -buildmachine -stdout -fullstdoutlogoutput -forcelogflush -unattended -nopause -nullrhi -nosplash \
  -ExecCmds="automation -help TestFileUtility; quit"

Run Tests

For run­ning tests, use the RunTests sub­com­mand. Here demon­strat­ed by run­ning Au­to­ma­tion through the ed­i­tor rather than the RunUAT scripts:

UE4Editor.exe YourProject.uproject ^
  -Game -NullRHI -NoSound ^
  -ExecCmds="Automation RunTests MyCategory" ^
  -TestExit="Automation Test Queue Empty" -Log

ExecCmds again spec­i­fies the com­mand to run, i.e. Automation RunTests <Group|Test|"All"> which can run tests in a giv­en group, spe­cif­ic tests or all of them. You can run mul­ti­ple tests with a white­space sep­a­rat­ed list: Automation RunTests Test1 Test2 Group1.

TestExit spec­i­fies the con­di­tion when to ex­it the au­to­ma­tion tool, in this case when the queue is emp­ty.

ue4­cli

A su­per use­ful tool that I found while in­ves­ti­gat­ing dock­er im­ages with UE4 in­stal­la­tions is “ue4­cli”. This slim python tool al­lows way more straight for­ward in­vo­ca­tion of RunUAT like this:

ue4 uat -help TestFileUtility

Isn’t that beau­ti­ful. Go check it out the ue4­cli GitHub re­pos­i­to­ry or in­stall it via pip:

pip install ue4cli