If you're looking to monitor or test the performance of an Android device using ADB (Android Debug Bridge) commands, there are several useful commands and tools available. Here's an overview of some commonly used ADB commands and techniques to check different performance metrics like CPU usage, memory usage, network stats, and more:
1. Check CPU Usage
adb shell top -n 1
Displays a snapshot of CPU usage by processes.
The -n 1 argument makes top run only once and exit.
Alternatively, for continuous monitoring:
adb shell top
2. Check Memory Usage
You can get overall memory info:
adb shell dumpsys meminfo
Or check memory usage of a specific app (replace package.name):
adb shell dumpsys meminfo package.name
3. Check Battery Usage
adb shell dumpsys battery
4. Check Network Usage
adb shell cat /proc/net/xt_qtaguid/stats
Or to monitor active network connections:
adb shell netstat
5. Profile GPU Rendering
To enable GPU rendering profile on device:
adb shell settings put global profile_gpu_rendering 1
This will show GPU rendering bars on the screen.
To disable:
adb shell settings put global profile_gpu_rendering 0
6. Check FPS (Frame Per Second)
You can use dumpsys gfxinfo to check frame stats:
adb shell dumpsys gfxinfo package.name
Analyze the output for frame rendering times to detect jank or dropped frames.
7. Systrace
systrace is a powerful profiling tool which captures detailed system and app performance data.