ADB Shell Top
First, the relevant parameters:
- >ADB Shell Top-h
- Usage:top [-M Max_procs] [-N iterations] [-D delay] [-s sort_column] [-t] [-h]
- -M Num Maximum number of processes to display . Show up to how many processes
- -N num Updates to Show before exiting. Number of refreshes
- -D num Seconds to wait between updates. Refresh interval (default 5 seconds)
- -S Col column to sort by (cpu,vss,rss,thr). Sorted by which column
- -T show threads instead of processes. Show thread information instead of process
- -H Display this help screen. Show Help Document
Like what:
ADB Shell Top-m 5
Indicates the number of 5 processes printed and the percentage of CPU value consumed by the associated process running.
The first column related parameter explanation:
- User is in the run time of the client state and does not contain a negative process with a priority value
- CPU time consumed by a process with a negative priority value
- Sys is in the running time of the nuclear mentality
- Idle wait time other than IO wait time
- IOW io Wait Time
- IRQ Hard Interrupt Time
- SIRQ Soft Interrupt Time PID process ID
The second column related parameter explanation:
- pid process ID
-  PR priority
- cpu% current instantaneous CPU utilization
- s process state: d= non-interruptible sleep state, r= run, s= sleep, t= trace/stop, z= Zombie process
- # The number of threads currently used by the THR program
- vss virtual set Size virtual memory consumption (contains memory consumed by shared library)
- rss resident set Size actual use of physical memory (contains memory consumed by shared libraries)
- pcy scheduling policy priority, Sp_background/sp_foreground
- UID Process owner User ID
- name process name
Second, the use of the command
- adb shell top-m xx view xx number of processes
- adb shell top-n xx refresh xx times
- adb shell top-d XX Refresh Frequency
- ......
Third, the printed data saved to the local
ADB shell top-m 5 > D:\cpu.txt data for printed 5 processes are saved to the Cpu.txt file in the local D drive
Fourth. specify to view data for an app
Example: monitoring the CPU usage of a microblog :adb shell top-n 1 | grep com.sina.weibo
10 seconds Refresh shows CPU usage:adb shell top-d | grep com.sina.weibo
Real-time monitoring of micro-blog CPU usage:adb shell top |grep Com.sina.weibo
ADB Shell top uses