bUATClosesAfterLaunch

bUATClosesAfterLaunch

#Overview

name: bUATClosesAfterLaunch

The value of this variable can be defined or overridden in .ini config files. 8 .ini config files referencing this setting variable.

It is referenced in 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bUATClosesAfterLaunch is to indicate whether the Unreal Automation Tool (UAT) closes immediately after launching on a specific platform or if it continues running to read output from the launched process.

This setting variable is primarily used in the Launcher Services module of Unreal Engine 5, specifically within the LauncherWorker and LauncherProfile classes. It’s part of the build and deployment system, which is responsible for packaging and launching projects on various platforms.

The value of this variable is set in the platform-specific .ini files and loaded into the DataDrivenPlatformInfo structure. It’s read from the configuration files using the DDPIGetBool function in the DataDrivenPlatformInfoRegistry.

bUATClosesAfterLaunch interacts with other variables and command-line parameters in the launcher system. For example, it affects whether the “-nokill” parameter is added to the UAT command, which prevents UAT from terminating after launch.

Developers must be aware that this variable’s behavior can vary depending on the target platform. Some platforms may require UAT to close immediately, while others may need it to remain open for monitoring or additional tasks.

Best practices when using this variable include:

  1. Ensure that platform-specific .ini files are correctly configured for each supported platform.
  2. When developing custom launch profiles or modifying the launcher system, check this variable to determine the appropriate post-launch behavior.
  3. Be mindful of how this setting might affect debugging and log collection, especially on platforms where UAT closes immediately after launch.
  4. When adding support for new platforms, consider carefully whether UAT should close after launch based on the platform’s requirements and limitations.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:20, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/IOS/DataDrivenPlatformInfo.ini:24, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/Linux/DataDrivenPlatformInfo.ini:24, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/LinuxArm64/DataDrivenPlatformInfo.ini:27, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:23, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/TVOS/DataDrivenPlatformInfo.ini:16, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:30, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Platforms/VisionOS/Config/DataDrivenPlatformInfo.ini:16, section: [DataDrivenPlatformInfo]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Developer/LauncherServices/Private/Launcher/LauncherWorker.cpp:415

Scope (from outer to inner):

file
function     FString FLauncherWorker::CreateUATCommand

Source code excerpt:

	TSet<FString> OptionalCookFlavors;
	
	bool bUATClosesAfterLaunch = false;
	for (int32 PlatformIndex = 0; PlatformIndex < InPlatforms.Num(); ++PlatformIndex)
	{
		// Platform info for the given platform
		const PlatformInfo::FTargetPlatformInfo* PlatformInfo = PlatformInfo::FindPlatformInfo(FName(*InPlatforms[PlatformIndex]));

		if (ensure(PlatformInfo))

#Loc: <Workspace>/Engine/Source/Developer/LauncherServices/Private/Launcher/LauncherWorker.cpp:451

Scope (from outer to inner):

file
function     FString FLauncherWorker::CreateUATCommand

Source code excerpt:

				OptionalParams += OptionalUATCommandLine;
			}
			bUATClosesAfterLaunch |= PlatformInfo->DataDrivenPlatformInfo->bUATClosesAfterLaunch;
		}
	}

	// If both Client/Game and Server are desired to be built avoid Server causing clients/game to not be built PlatformInfo wise
	if (ServerPlatforms.Len() > 0 && Platforms.Len() > 0 && OptionalParams.Contains(TEXT("-noclient")))
	{

#Loc: <Workspace>/Engine/Source/Developer/LauncherServices/Private/Launcher/LauncherWorker.cpp:807

Scope (from outer to inner):

file
function     FString FLauncherWorker::CreateUATCommand

Source code excerpt:

			//will still need it.  If UAT DOES stick around with the process then we DO want the COTF server to die with UAT so the next time we launch we don't end up
			//with two COTF servers.
			if (bUATClosesAfterLaunch)
			{
				UATCommand += " -nokill";
			}
			UATCommand += MapList;

			FCommandDesc Desc;

#Loc: <Workspace>/Engine/Source/Developer/LauncherServices/Private/Profiles/LauncherProfile.h:1747

Scope (from outer to inner):

file
class        class FLauncherProfile final : public ILauncherProfile
function     bool FindAllPlatforms

Source code excerpt:

	bool FindAllPlatforms(TArray<FString>& ServerPlatforms, TArray<FString>& ClientPlatforms, FString& OptionalParams)
	{
		bool bUATClosesAfterLaunch = false;
		TArray<FString> InPlatforms = FindPlatforms();
		for (int32 PlatformIndex = 0; PlatformIndex < InPlatforms.Num(); ++PlatformIndex)
		{
			// Platform info for the given platform
			const PlatformInfo::FTargetPlatformInfo* PlatformInfo = PlatformInfo::FindPlatformInfo(FName(*InPlatforms[PlatformIndex]));
			if (PlatformInfo == nullptr)

#Loc: <Workspace>/Engine/Source/Developer/LauncherServices/Private/Profiles/LauncherProfile.h:1768

Scope (from outer to inner):

file
class        class FLauncherProfile final : public ILauncherProfile
function     bool FindAllPlatforms

Source code excerpt:

			}

			bUATClosesAfterLaunch |= PlatformInfo->DataDrivenPlatformInfo->bUATClosesAfterLaunch;
		}

		// If both Client and Server are desired to be built avoid Server causing clients to not be built PlatformInfo wise
		if (OptionalParams.Contains(TEXT("-client")) && OptionalParams.Contains(TEXT("-noclient")))
		{
			OptionalParams = OptionalParams.Replace(TEXT("-noclient"), TEXT(""));
		}

		return bUATClosesAfterLaunch;
	}

	virtual bool Load(const FJsonObject& Object) override
	{
		int32 Version = (int32)Object.GetNumberField(TEXT("Version"));
		if (Version < LAUNCHERSERVICES_FILEFORMATCHANGE || Version > LAUNCHERSERVICES_FINAL)

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Misc/DataDrivenPlatformInfoRegistry.cpp:387

Scope (from outer to inner):

file
function     static void LoadDDPIIniSettings

Source code excerpt:

	DDPIGetBool(IniFile, TEXT("bCanUseCrashReporter"), Info.bCanUseCrashReporter);
	DDPIGetBool(IniFile, TEXT("bUsesHostCompiler"), Info.bUsesHostCompiler);
	DDPIGetBool(IniFile, TEXT("bUATClosesAfterLaunch"), Info.bUATClosesAfterLaunch);
	DDPIGetBool(IniFile, TEXT("bIsEnabled"), Info.bEnabledForUse);

	DDPIGetName(IniFile, TEXT("UBTPlatformName"), Info.UBTPlatformName);
	// if unspecified, use the ini platform name (only Win64 breaks this)
	if (Info.UBTPlatformName == NAME_None)
	{

#Loc: <Workspace>/Engine/Source/Runtime/Core/Public/Misc/DataDrivenPlatformInfoRegistry.h:214

Scope: file

Source code excerpt:


	/** Whether UAT closes immediately after launching on this platform, or if it sticks around to read output from the running process */
	bool bUATClosesAfterLaunch;

	/** Whether or not this editor/program has compiled in support for this platform (by looking for TargetPlatform style DLLs, without loading them) */
	bool bHasCompiledTargetSupport;