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 FPSWhen 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.