1 adb shell ps -A 可以查看所有的进程,包括stop的进程
以下默认已经进入adb shell
2 输出结果按pid排序:
ps -A -o pid,ppid,name,etime,rss --sort pid
3 统计当前系统的进程总数
ps -Af -o pid,name,cpu,ELAPSED,rss -k -rss | wc -l
3 按照内存使用降序排列
ps -Af -o pid,name,cpu,ELAPSED,rss -k -rss
4 按照内存使用升序排列
ps -Af -o pid,name,cpu,ELAPSED,rss -k rss
5 输出结果按进程状态排序
ps -A -o pid,name,s -k s
6 show一个进程所有的线程:1007是pid 。
ps 1007 -AT