做网站数据库要建什么表,地产集团网站建设,wordpress 截取中文,网站引流是什么意思目录 前言一、命令参数二、输出结果含义 前言
在adb shell终端#xff0c;输入 ps#xff0c;可查看手机当前所有的进程状态#xff0c;其中ps的英文全称是Process Status。 ps命令对于分析系统异常情况时都是必备的技能#xff0c;需要通过这个简单命令来查看系统真实的状… 目录 前言一、命令参数二、输出结果含义 前言
在adb shell终端输入 ps可查看手机当前所有的进程状态其中ps的英文全称是Process Status。 ps命令对于分析系统异常情况时都是必备的技能需要通过这个简单命令来查看系统真实的状态。
一、命令参数
-A: 显示所有进程包括与控制终端无关的进程。-a: 显示所有终端与 -d 相反。-d: 显示所有进程但不包括会话领导者。-e: 显示所有进程与 -A 选项相同。-g: 以进程组来显示进程。-G: 以实际组名来显示进程在sgid之前。-p: 根据指定的PID来显示进程。-P: 根据父PID来显示进程。-s: 在会话ID中显示进程。-t: 附加到指定的TTY终端上的进程。-T: 显示线程信息。-u: 根据指定的用户名来显示进程。-U: 根据实际用户名来显示进程在suid之前。
上面的参数可根据需要自由组合比如查看系统中所有进程的基本信息 adb shell ps -A
查看特定进程的线程信息以PID为例可以在ps命令或其他命令中获取特定进程的PID adb shell ps -T PID
1|trinket:/ # ps -T 31144
USER PID TID PPID VSZ RSS WCHAN ADDR S CMD
u0_a115 31144 31144 597 5707888 96156 SyS_epoll 0 S mservice:remote
u0_a115 31144 31150 597 5707888 96156 futex_wai 0 S Jit thread pool
u0_a115 31144 31155 597 5707888 96156 do_sigtim 0 S Signal Catcher
u0_a115 31144 31156 597 5707888 96156 poll_sche 0 S ADB-JDWP Connec
u0_a115 31144 31157 597 5707888 96156 futex_wai 0 S HeapTaskDaemon
u0_a115 31144 31158 597 5707888 96156 futex_wai 0 S ReferenceQueueD
u0_a115 31144 31159 597 5707888 96156 futex_wai 0 S FinalizerDaemon
u0_a115 31144 31160 597 5707888 96156 futex_wai 0 S FinalizerWatchd
u0_a115 31144 31161 597 5707888 96156 binder_io 0 S Binder:31144_1
u0_a115 31144 31162 597 5707888 96156 binder_io 0 S Binder:31144_2
u0_a115 31144 31165 597 5707888 96156 binder_io 0 S Binder:31144_3
u0_a115 31144 31173 597 5707888 96156 futex_wai 0 S Profile Saver
u0_a115 31144 31175 597 5707888 96156 binder_io 0 S HwBinder:31144_
u0_a115 31144 31232 597 5707888 96156 binder_io 0 S Binder:31144_4
u0_a115 31144 31233 597 5707888 96156 SyS_epoll 0 S queued-work-loo查看所有普通应用程序老版本android是单用户的所以用户普通进程的user都是以u0开头的google有意把android发展成支持多用户的现在已经有u1, u2_等等的用户名另外普通app的uid是从10000开始
ps -A |grep u0
u0_a111 2036 597 6654872 199308 SyS_epoll_wait 0 S com.android.systemui
u0_a112 2401 597 6294320 164404 SyS_epoll_wait 0 S com.android.launcher3
u0_a56 2477 597 5758552 91156 SyS_epoll_wait 0 S android.ext.services
u0_a130 2560 597 5770632 109984 SyS_epoll_wait 0 S com.android.inputmethod.latin
u0_a89 3035 597 5770064 95024 SyS_epoll_wait 0 S com.qualcomm.qti.sva
u0_a97 3090 597 5717908 89052 SyS_epoll_wait 0 S .pasr
u0_a119 3131 597 5735684 92332 SyS_epoll_wait 0 S com.qualcomm.qti.services.systemhelper:systemhelper_service
u0_a88 3353 597 5651104 83940 SyS_epoll_wait 0 S com.android.smspush
u0_a48 3652 597 5803580 103868 SyS_epoll_wait 0 S android.process.media
u0_a118 4427 597 5704704 83668 SyS_epoll_wait 0 S com.qualcomm.qti.callenhancement
u0_a135 5277 597 5722432 87816 SyS_epoll_wait 0 S com.qualcomm.telephony
u0_a58 11871 597 6139768 160692 SyS_epoll_wait 0 S org.codeaurora.snapcam
u0_a138 12967 597 5633764 89704 SyS_epoll_wait 0 S org.chromium.webview_shell
u0_a168 13165 597 5678620 103000 SyS_epoll_wait 0 S com.quectel.cardiagnosis
u0_a162 13199 597 5844304 180444 SyS_epoll_wait 0 S com.example.hxplay
u0_a144 13233 597 5835764 146244 SyS_epoll_wait 0 S com.henry.basic
u0_a63 19299 597 5679996 82448 SyS_epoll_wait 0 S com.android.cellbroadcastreceiver
u0_a81 19936 597 5679012 86284 SyS_epoll_wait 0 S com.android.printspooler
u0_a51 19949 597 5722976 95068 SyS_epoll_wait 0 S com.android.providers.calendar
u0_a44 28312 597 5748860 106720 SyS_epoll_wait 0 S android.process.acore
u0_a160 28563 597 5748916 119836 SyS_epoll_wait 0 S com.android.audiotest
u0_a140 28725 598 1879448 90096 SyS_epoll_wait 0 S com.android.webview:webview_service
u0_a52 28851 597 5802572 138512 SyS_epoll_wait 0 S com.android.permissioncontroller
u0_a106 30983 597 5771068 99520 SyS_epoll_wait 0 S com.android.dialer
u0_a115 31144 597 5707888 96156 SyS_epoll_wait 0 S com.qualcomm.qti.seccamservice:remote二、输出结果含义
例如在手机输出如下命令20671是某个进程pid ps -A |grep -E NAME| 13199
USER PID PPID VSZ RSS WCHAN ADDR S NAME
u0_a162 13199 597 5844304 180444 0 0 S com.example.hxplay结果分析
字段含义值USER所有者用户的用户名表示运行进程的用户。u0_a162PID进程IDProcess ID唯一标识每个进程的数字。13199PPID父进程IDParent Process ID标识创建当前进程的父进程的ID。597VSZ虚拟内存大小Virtual Memory Size进程当前使用的虚拟内存大小以KB为单位。5844304RSS常驻集大小Resident Set Size表示进程占用的物理内存大小以KB为单位。180444WCHAN当前等待的内核函数The name of the kernel function in which the process is sleeping。0ADDR内存地址Memory Address进程的内存地址。0S进程状态表示进程的当前状态此处为S表示休眠sleeping状态。SNAME命令名Command Name表示进程的名称或命令。com.example.hxplay
注 WCHAN值为0代表进程处于运行态否则代表内核地址(休眠态)。
参考链接
adb中ps命令的详解