Unreal Insights is a great new profiling and analysis tool that allows you to quickly find bottlenecks, performance spikes, threading patterns and much more. Any Unreal Engine developer building a game or app for Oculus Quest should have Unreal Insights in their toolbelt. The set-up process takes a short amount of time and after you do it once, it's set up forever and you’ll wonder how you ever lived without it. Let’s get started.
Install the development app and verify the existence of /sdcard/UE4Game/<ProjectName>. You might need to launch the game for the first time for the binary to create its associated UE4 project directory.
Instruct adb to pass through TCP connections made on the device over USB (Unreal Insights listens on TCP port 1980): adb reverse tcp:1980 tcp:1980
Edit your UE4CommandLine.txt file to do what you want
Locate the template file in <CloneDir>\UnrealEngine\Engine\Build\Android\UE4Game
Find UE4CommandLine.txt.template & copy/paste it, then remove the .template extension at the end
Modify this file however you like. (See the format just below these steps as a guide)
Copy your desired UE4CommandLine.txt file to your project’s root directory on device
Open UnrealInsights.exe and check the box for Auto-start analysis for LIVE trace sessions if desired
Go in your headset and run the map! You should see the trace being filled out in the Unreal Insights window.


Notes on each dir/flag shown above:
<ProjectName>
<UProjectName>
<MapName>
This one is optional, but it allows you to customize launch arguments on a per-map basis. If you know the map name, you can just put it here.
Pro Tip: if you have a benchmarking scene that you are using, you can set up tracing for only that map so that the tracing overhead doesn’t affect other profiling on regular maps. This is nice because you can keep that launch arg file in the same location without having to remove or rename it between play types.
-trace
-statnamedevents
-tracehost
-tracefile
Example Project


As an example, I built a quick project called QuestUnrealDemo based on the VR Template and set the default map to MotionControllerMap.The uproject is the same, QuestUnrealDemo. The full package name is com.YourCompany.QuestUnrealDemo.

Push the updated UE4CommandLine.txt file to your project root directory on device
Launch Unreal Insights and check the Auto-start analysis for LIVE trace sessions checkbox if you wish.
Launch your game! The live trace will start on launch within the Unreal Insights window.