I am trying to launch my game on Android with some command line arguments. Specifically I would like to use either of the trace options in the Insights documentation. I cannot find any way to set command line arguments, either via Launch in editor, or packaging and installing a build using a bat file.
I have tried
modifying the UE4CommandLine.txt, and putting it in my game folder on the android device
modifying the UE4CommandLine.txt, and putting it in /mnt/sdcard/UE4Game/UE4Game/UE4CommandLine.txt, as with PushCommandLine.bat
using the editor preferences’ additional launch parameters for mobile
The game runs fine, but none of the command line arguments seem to be applied.
Any ideas? Thank you!
Patrick
Ok, I fixed the problem by upgrading to UE 4.24, and making sure to modify the existing UE4CommandLine in the device’s game folder. I can now create a tracefile, then copy it to my computer to view it in Insights.
For packaged builds, I run these commands in a bat file to run the game on Android:
%ANDROID_HOME%\platform-tools\adb.exe push UE4CommandLine.txt /mnt/sdcard/UE4Game/PROJECTNAME/UE4CommandLine.txt
%ANDROID_HOME%\platform-tools\adb.exe shell am start -n com.COMPANYNAME.EXENAME/com.epicgames.ue4.SplashActivity
I also found out you can run console commands via adb, such as: adb shell am broadcast -a android.intent.action.RUN -e cmd 'stat sceneRendering’
I’ll sugest you to use FAndroidMisc::GamePersistentDownloadDir() to find out what is a valid location to use for your trace to be written.
I added the following in my GameMode Tick function, then I built the game and ran it so I can see in the screen the debug msg with the path.