Command
ADB Shell PS
-T view information for a thread in a process-X view Utime and Stime-p View Properties-P View the scheduling policy, usually to see if an app is in front or background-C to see which CPU is executing the process name|pid filter by name or PID
Example
(1) View the thread with the package name Com.eat, which is the UI thread that the com.eat applies to.
adb shell ps-t |grep com.eat app_62 21964 127748 17012 ffffffff
00000000 S com.eat
UID:APP_62 (when the program is installed, the system is assigned.) Linux is a multiuser system, and in Android, a user is quite an application. )
pid:21964 (Process ID)
ppid:141 (This is the zygote process, because all of the Android apps are "hatched" from this process.) )
Alternatively, you can use DDMS to view information about the process.
(2) View all threads in the app_62 application.
adb shell ps-t |grep app_62 app_62 21964 127748 17012 ffffffff 00000000 S com.eat
app_62 21965 21 964 127748 17012 Ffffffff 00000000 S heapworker app_62 21966 21964 127748 17012 ffffffff 00000000 S GC
app_62< c8/>21967 21964 127748 17012 ffffffff 00000000 S Signal catcher app_62 21968 21964 127748 17012 ffffffff 00000000 S JDWP
app_62 21969 21964 127748 17012 ffffffff 00000000 S Compiler app_62 21970 21964 127748 17012 F Fffffff 00000000 S Binder thread # app_62 21971 21964 127748 17012 ffffffff \ 00000000 s Binder Thread #
A new application consists of no more than 10 threads, most of which are dalvik internal threads. From an application perspective, you don't need to care about them.
All other threads except Com.eat are Ppid 21966, which is com.eat pid. This is because these threads are hatched from the UI thread.
There are 3 threads to care about, respectively:
app_62 21964 127748 17012 ffffffff 00000000 S com.eat
app_62 21970 21964 127748 17012 ffffffff 000000 s Binder Thread #
app_62 21971 21964 127748 17012 ffffffff 00000000 S Binder Thread #
It is not hard to see that com.eat is a UI thread, and another 2 binder threads are used to invoke some services of the system, one is Applicationthead, the other is VIEWROO.W object.
Resources
http://blog.csdn.net/manoel/article/details/39500351