Question about why `Param.RunCommandline` is no longer parsed in AutomationTool

I was tracking an issue related to missing commandline arguemnts in “uecommandline.txt” in UE 5.3, while they were present in UE4.27.

I found that in Unreal 4.27, the commandline for “uecommandline.txt” included both commandline context from `Params.StageCommandline` and `Params.RunCommandline`. (UE4.27 source code) (CopyBuildToStagingDirectory.Automation.cs, line 3861)

However, `Params.RunCommandline` is not parsed in UE5. (UE5.3 source code) (CopyBuildToStagingDirectory.Automation.cs, line 4664-4667)

I am wondering is there any reason why `Params.RunCommandline` is no longer parsed?

A proposed change is in this PR: https://github.com/EpicGames/UnrealEngine/pull/13294

Steps to Reproduce

Hey there Shifeng,

The original change was made here: “Pass RunCommandline during launch to improve iteration times on mobile by not needing to rebuild .apk every time, because they are not passed via staged build anymore.”

The key issue here is if we pass run command line arguments like that we would need to rebuild .apk, because uecommandline.txt is bundled with-in .apk, and it’s like 20-30+ seconds to rebuild it.

What are you trying to use this for? This change is by design as run arguments are not really part of a “packaged build”.

I’ve included the dev ([mention removed]​) here that made the change in case they have any further context beyond the above they’ve provided.

Kind regards,

Julian

Hi Julian, thanks for you reply! From the commit you linked, the help message of `RunCommandline` has change to “Additional command line arguments for the program, which will not be staged in UECommandLine.txt in most cases”.

Which cases are referred by “most cases” in this context? And what are the other exceptions? It looks to me that the current codebase fully removes the `RunCommandline` from “UECommandLine.txt”.

Hi [Content removed]

In UE we have two types of commandlines:

- StageCommandline

- RunCommandline

Because UECommandLine.txt is packaged inside a package build (e.g. inside .apk or .ipa) we only package StageCommandline because this should be sufficient to run the packaged build on it’s own.

For example imagine using RunCommandline for something customizing some cvars for testing, it would be suboptimal to repackage and reinstall .apk/.ipa every time we want to change the tested cvar.

Instead RunCommandline on Android is provided externally via

- adb shell am start … --e cmdline “…”

- storage location like /sdcard/Android/data/…/files/UnrealGame/…/UECommandLine.txt

See how it’s implemented in https://github.com/EpicGames/UnrealEngine/blob/ue5\-main/Engine/Source/Runtime/Launch/Private/Android/LaunchAndroid.cpp\#L373\-L486

From what I can see they are combined on SteamDeck platform.

I’ve digged a bit deeper, RunCommandline is used when we do Quick Launch on Android from UE via:

- added to overall launch cmd line here https://github.com/EpicGames/UnrealEngine/blob/ue5\-main/Engine/Source/Programs/AutomationTool/Scripts/RunProjectCommand.Automation.cs\#L748

- passed to the app via am start here https://github.com/EpicGames/UnrealEngine/blob/ue5\-main/Engine/Source/Programs/AutomationTool/Android/AndroidPlatform.Automation.cs\#L4291\-L4303

If your game doesn’t rely on Quick Launch, maybe it would be possible to modify the way how you launch your game and pass it there?