To prepare your environment for debugging and optimizing Android games, get access to the following tools that help you analyze CPU usage and graphics calls.
Use the following tools to evaluate and improve your game's CPU performance:
- Systrace: Records CPU and disk activity over a short period of time. Access this tool from the command line, or use the on-device tool that's available when running Android 9 (API level 28) or higher. Also see the overview of system tracing.
- CPU Profiler: Inspect your game's CPU usage and thread activity, either in real time or from recorded traces. See documentation on how to access and use the CPU Profiler in Android Studio.
- Meminfo: Collects memory statistics to show how much
was allocated and the categories for which it was used. Use the command
adb shell dumpsys meminfo package-nameor the
- Perfetto: Collects performance and memory information on a device and displays it in a web-based UI. Perfetto supports arbitrarily long traces so you can view how RSS changes over time. Enable long traces from the System Tracing app.
- bugreport: Shows if your game crashed because it ran out of memory or if
it was killed by the
LMK. Use the
adb bugreport bugreport-nameor go to Developer Options > Bug report.
Use the following tools to evaluate and improve your game's display pipeline:
- Android Frame Pacing API: Helps synchronize your game engine's rendering process with Android's display pipeline. Download from the Android Open Source Project (AOSP), or access the plugin from Unity 2019.2.0 Alpha 6 or higher. Also see documentation for the Android Frame Pacing API.
Graphics API Debugger (GAPID): Helps you inspect and improve calls to a graphics driver. Download the latest version that includes an asset whose name is formatted as follows: