Automation Tool

Основная подпрограмма для автоматизации процессов в Unreal Engine называется Automation Tool (UAT). Находится она в директории движка:

C:\Epic Games\UE Binary\UE_4.26\Engine\Binaries\DotNET\AutomationTool.exe

Ее можно вызвать напрямую, либо с использованием bat файла RunUAT.bat (я предпочитаю второй способ), что в целом эквивалентно (RunUAT компилирует Automation Tool из исходников, если не может ее найти, и запускает программу после этого).

RunUAT.bat находится в корневой директории движка:

C:\Epic Games\UE Binary\UE_4.26\Engine\Build\BatchFiles\RunUAT.bat

Посмотреть список параметров можно с помощью флага -help, вывод примерно следующий:

C:\>"C:\Epic Games\UE Binary\UE_4.26\Engine\Build\BatchFiles\RunUAT.bat" -help
Running AutomationTool...
Parsing command line: -help

Automation Help:

Executes scripted commands

AutomationTool.exe [-verbose] [-compileonly] [-p4] Command0 [-Arg0 -Arg1 -Arg2 ...] Command1 [-Arg0 -Arg1 ...] Command2 [-Arg0 ...] Commandn ...
[EnvVar0=MyValue0 ... EnvVarn=MyValuen]

Parameters:
    -verbose                Enables verbose logging
    -nop4                   Disables Perforce functionality (default if not run on a build machine)
    -p4                     Enables Perforce functionality (default if run on a build machine)
    -compileonly            Does not run any commands, only compiles them
    -compile                Dynamically compiles all commands (otherwise assumes they are already built)
    -help                   Displays help
    -list                   Lists all available commands
    -submit                 Allows UAT command to submit changes
    -nosubmit               Prevents any submit attempts
    -nokill                 Does not kill any spawned processes on exit
    -ignorejunk             Prevents UBT from cleaning junk files
    -UseLocalBuildStorage   Allows you to use local storage for your root build storage dir (default of P:\Builds (on PC) is changed to Engine\Saved\LocalBuilds). Used for local testing.   
AutomationTool exiting with ExitCode=0 (Success)

Как мы видим по справке, список всех команд можно получить с помощью команды -list:

C:\>"C:\Epic Games\UE Binary\UE_4.26\Engine\Build\BatchFiles\RunUAT.bat" -list
Running AutomationTool...
Parsing command line: -list

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

Команд очень много. Нас будет интересовать лишь несколько. Увидим это на следующих страницах wiki.

По каждой команде можно также получить дополнительную справку по доступным параметрам. Например, сделаем это для BuildCookRun:

"C:\Epic Games\UE Binary\UE_4.26\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -help

Вывод будет примерно следующим:

C:\>"C:\Epic Games\UE Binary\UE_4.26\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -help
Running AutomationTool...
Parsing command line: BuildCookRun -help

BuildCookRun Help:

Builds/Cooks/Runs a project.

For non-uprojects project targets are discovered by compiling target rule files found in the project folder.
If -map is not specified, the command looks for
DefaultMap entry in the projects DefaultEngine.ini and if not found, in BaseEngine.ini.
If no DefaultMap can be found, the command falls back to /Engine/Maps/Entry.

Parameters:
    -project=Path                      Project path (required), i.e: -project=QAGame, -project=Samples\BlackJack\BlackJack.uproject, -project=D:\Projects\MyProject.uproject
    -destsample                        Destination Sample name
    -foreigndest                       Foreign Destination
    -targetplatform=PlatformName       target platform for building, cooking and deployment (also -Platform)
    -servertargetplatform=PlatformName target platform for building, cooking and deployment of the dedicated server (also -ServerPlatform)
    -foreign                           Generate a foreign uproject from blankproject and use that
    -foreigncode                       Generate a foreign code uproject from platformergame and use that
    -CrashReporter                     true if we should build crash reporter
    -cook,                             -cookonthefly Determines if the build is going to use cooked data
    -skipcook                          use a cooked build, but we assume the cooked data is up to date and where it belongs, implies -cook
    -skipcookonthefly                  in a cookonthefly build, used solely to pass information to the package step
    -clean                             wipe intermediate folders before building
    -unattended                        assumes no operator is present, always terminates without waiting for something.
    -pak                               generate a pak file
    -iostore                           generate I/O store container file(s)
    -signpak=keys                      sign the generated pak file with the specified key, i.e. -signpak=C:\Encryption.keys. Also implies -signedpak.
    -prepak                            attempt to avoid cooking and instead pull pak files from the network, implies pak and skipcook
    -signed                            the game should expect to use a signed pak file.
    -PakAlignForMemoryMapping          The game will be set up for memory mapping bulk data.
    -skippak                           use a pak file, but assume it is already built, implies pak
    -skipiostore                       override the -iostore commandline option to not run it
    -stage                             put this build in a stage directory
    -skipstage                         uses a stage directory, but assumes everything is already there, implies -stage
    -manifests                         generate streaming install manifests when cooking data
    -createchunkinstall                generate streaming install data from manifest when cooking data, requires -stage & -manifests
    -archive                           put this build in an archive directory
    -build                             True if build step should be executed
    -noxge                             True if XGE should NOT be used for building
    -CookPartialgc                     while cooking clean up packages as we are done with them rather then cleaning everything up when we run out of space
    -CookInEditor                      Did we cook in the editor instead of in UAT
    -IgnoreCookErrors                  Ignores cook errors and continues with packaging etc
    -nodebuginfo                       do not copy debug files to the stage
    -separatedebuginfo                 output debug info to a separate directory
    -MapFile                           generates a *.map file
    -nocleanstage                      skip cleaning the stage directory
    -run                               run the game after it is built (including server, if -server)
    -cookonthefly                      run the client with cooked data provided by cook on the fly server
    -Cookontheflystreaming             run the client in streaming cook on the fly mode (dont cache files locally instead force reget from server each file load)
    -fileserver                        run the client with cooked data provided by UnrealFileServer
    -dedicatedserver                   build, cook and run both a client and a server (also -server)
    -client                            build, cook and run a client and a server, uses client target configuration
    -noclient                          do not run the client, just run the server
    -logwindow                         create a log window for the client
    -package                           package the project for the target platform
    -skippackage                       Skips packaging the project for the target platform
    -distribution                      package for distribution the project
    -prereqs                           stage prerequisites along with the project
    -applocaldir                       location of prerequisites for applocal deployment
    -Prebuilt                          this is a prebuilt cooked and packaged build
    -AdditionalPackageOptions          extra options to pass to the platform's packager
    -deploy                            deploy the project for the target platform
    -getfile                           download file from target after successful run
    -IgnoreLightMapErrors              Whether Light Map errors should be treated as critical
    -stagingdirectory=Path             Directory to copy the builds to, i.e. -stagingdirectory=C:\Stage
    -ue4exe=ExecutableName             Name of the UE4 Editor executable, i.e. -ue4exe=UE4Editor.exe
    -archivedirectory=Path             Directory to archive the builds to, i.e. -archivedirectory=C:\Archive
    -archivemetadata                   Archive extra metadata files in addition to the build (e.g. build.properties)
    -createappbundle                   When archiving for Mac, set this to true to package it in a .app bundle instead of normal loose files
    -iterativecooking                  Uses the iterative cooking, command line: -iterativecooking or -iterate
    -CookMapsOnly                      Cook only maps this only affects usage of -cookall the flag
    -CookAll                           Cook all the things in the content directory for this project
    -SkipCookingEditorContent          Skips content under /Engine/Editor when cooking
    -FastCook                          Uses fast cook path if supported by target
    -cmdline                           command line to put into the stage in UE4CommandLine.txt
    -bundlename                        string to use as the bundle name when deploying to mobile device
    -map                               map to run the game with
    -AdditionalServerMapParams         Additional server map params, i.e ?param=value
    -device                            Devices to run the game on
    -serverdevice                      Device to run the server on
    -skipserver                        Skip starting the server
    -numclients=n                      Start extra clients, n should be 2 or more
    -addcmdline                        Additional command line arguments for the program
    -servercmdline                     Additional command line arguments for the program
    -clientcmdline                     Override command line arguments to pass to the client
    -nullrhi                           add -nullrhi to the client commandlines
    -fakeclient                        adds ?fake to the server URL
    -editortest                        rather than running a client, run the editor instead
    -RunAutomationTests                when running -editortest or a client, run all automation tests, not compatible with -server
    -Crash=index                       when running -editortest or a client, adds commands like debug crash, debug rendercrash, etc based on index
    -deviceuser                        Linux username for unattended key genereation
    -devicepass                        Linux password
    -RunTimeoutSeconds                 timeout to wait after we lunch the game
    -SpecifiedArchitecture             Determine a specific Minimum OS
    -UbtArgs                           extra options to pass to ubt
    -MapsToRebuildLightMaps            List of maps that need light maps rebuilding
    -MapsToRebuildHLODMaps             List of maps that need HLOD rebuilding
    -ForceMonolithic                   Toggle to combined the result into one executable
    -ForceDebugInfo                    Forces debug info even in development builds
    -ForceNonUnity                     Toggle to disable the unity build system
    -ForceUnity                        Toggle to force enable the unity build system
    -Licensee                          If set, this build is being compiled by a licensee
    -NoSign                            Skips signing of code/content files.
AutomationTool exiting with ExitCode=0 (Success)

Last updated