I'm trying to monitor the list of threads a process has. I'm hoping it can be viewed via ADB Shell. I am aware of listing the process:
adb shell ps -p
But how do i go an extra layer deeper for that process' threads?
Using: Android 4.4.2
You can find the option you need using adb shell ps --help. One way is to use adb shell ps -T | grep <PID>, where <PID> is the thread ID. You can find it using adb shell ps -A
Example on Windows 10:
PS C:\Users\languoguang> adb shell ps -A | findstr "system_server"
system 3107 1218 14800384 722996 do_epoll_wait 0 S system_server
PS C:\Users\languoguang> adb shell ps -T | findstr "3107" | findstr "Input"
system 3107 3332 1218 14800384 723868 do_epoll_wait 0 S InputDispatcher
system 3107 3333 1218 14800384 723868 do_epoll_wait 0 S InputReader
PS C:\Users\languoguang>
The command you are looking for is ps -t. That would do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With