Skip to main content
Use adb commands via device.adb(...) to collect FPS and CPU metrics during a flow and assert on rendering performance and CPU load. See the Android dumpsys documentation for more on SurfaceFlinger stats.
Performance measurements run on the Android emulator. FPS values reflect emulator rendering, not physical device GPU performance. CPU values are per-core percentages and can exceed 100% on multi-core emulators (typically 4 cores).

Examples

Assert average FPS
If the device is idle when you collect stats, the reported FPS may be near zero because there is no active rendering. Always start measuring immediately before a rendering-heavy action.
Sample CPU usage

When to use

  • Your app has animations or rendering-heavy screens and you need to assert on frame rate.
  • Your app performs background processing and you need to verify CPU usage stays within acceptable limits.
  • Your flow includes a workflow that should complete without excessive CPU load.
  • Your team has performance budgets you want to enforce in CI.

Full sample test

Last modified on June 4, 2026