No "---PROFILEDATA---" is being generated by the "adb shell dumpsys gfxinfo <package name> framestats" command."

I encountered an issue while testing to apply Baseline Profiles to Android app developed with Unity.

The problem arises when using Macrobenchmark tool, which uses the startActivityAndWait function mainly. This function relies on the "adb shell dumpsys gfxinfo <package name> framestats" command to determine when the app has finished loading. It specifically looks for the ---PROFILEDATA--- section in the command’s output and compares frame times to detect completion.

Unfortunately, an Android app built with Unity does not generate this information when I use the aforementioned command. It fails to include the expected data, similar to the example below, which should normally be part of the output:


I tested the same "adb shell dumpsys gfxinfo <package name> framestats" command on other Android apps, and in all cases, they successfully printed the ---PROFILEDATA--- section to the console.

I suspect the issue arises from Unity’s reliance on OpenGL or Vulkan for rendering, which functions differently from Android’s native UI rendering. Hence, I tried using Android’s own native UI along with Unity’s, but the issue wasn’t fixed.

Is there a way or option to generate PROFILEDATA from a Unity-based Android application?

Thank you for taking the time to read this.

Tested this using Untiy 2022.3.20