查看android app 线程信息的命令

参考:https://my.oschina.net/zhiweiofli/blog/138454

ps | grep 'joyodream'  找到 app 的pid; joyodream为包名的一部分
ps -t pid 查找指定pid的线程信息 例如:

 ps -t 14500
360 手机

USER PID PPID VSIZE RSS WCHAN PC NAME
u0_a118 14500 375 2521896 137196 SyS_epoll_ 0000000000 S com.joyodream.bindtest
u0_a118 14506 14500 2521896 137196 do_sigtime 0000000000 S Signal Catcher
u0_a118 14507 14500 2521896 137196 poll_sched 0000000000 S JDWP
u0_a118 14508 14500 2521896 137196 futex_wait 0000000000 S ReferenceQueueD
u0_a118 14509 14500 2521896 137196 futex_wait 0000000000 S FinalizerDaemon
u0_a118 14510 14500 2521896 137196 futex_wait 0000000000 S FinalizerWatchd
u0_a118 14511 14500 2521896 137196 futex_wait 0000000000 S HeapTaskDaemon
u0_a118 14512 14500 2521896 137196 binder_thr 0000000000 S Binder_1
u0_a118 14513 14500 2521896 137196 binder_thr 0000000000 S Binder_2
u0_a118 14515 14500 2521896 137196 SyS_epoll_ 0000000000 S RenderThread
u0_a118 14517 14500 2521896 137196 futex_wait 0000000000 S mali-mem-purge
u0_a118 14518 14500 2521896 137196 kbase_read 0000000000 S mali-event-hnd
u0_a118 14519 14500 2521896 137196 futex_wait 0000000000 S mali-utility-wo
u0_a118 14520 14500 2521896 137196 futex_wait 0000000000 S mali-utility-wo
u0_a118 14521 14500 2521896 137196 futex_wait 0000000000 S mali-utility-wo
u0_a118 14522 14500 2521896 137196 futex_wait 0000000000 S mali-utility-wo
u0_a118 14523 14500 2521896 137196 futex_wait 0000000000 S mali-utility-wo
u0_a118 14524 14500 2521896 137196 futex_wait 0000000000 S mali-utility-wo
u0_a118 14525 14500 2521896 137196 futex_wait 0000000000 S mali-utility-wo
u0_a118 14526 14500 2521896 137196 futex_wait 0000000000 S mali-utility-wo
u0_a118 14527 14500 2521896 137196 futex_wait 0000000000 S mali-utility-wo
u0_a118 14528 14500 2521896 137196 futex_wait 0000000000 S mali-utility-wo
u0_a118 14529 14500 2521896 137196 futex_wait 0000000000 S mali-renderer
u0_a118 14530 14500 2521896 137196 futex_wait 0000000000 S mali-hist-dump
u0_a118 14531 14500 2521896 137196 futex_wait 0000000000 S ged-swd
u0_a118 14533 14500 2521896 137196 futex_wait 0000000000 S hwuiTask1

 

1+ 手机

u0_a100 19418 284 1609932 43208 ffffffff 00000000 S com.joyodream.bindtest
u0_a100 19424 19418 1609932 43208 ffffffff 00000000 S Heap thread poo
u0_a100 19425 19418 1609932 43208 ffffffff 00000000 S Heap thread poo
u0_a100 19426 19418 1609932 43208 ffffffff 00000000 S Heap thread poo
u0_a100 19427 19418 1609932 43208 ffffffff 00000000 S Signal Catcher
u0_a100 19428 19418 1609932 43208 ffffffff 00000000 S JDWP
u0_a100 19429 19418 1609932 43208 ffffffff 00000000 S ReferenceQueueD
u0_a100 19430 19418 1609932 43208 ffffffff 00000000 S FinalizerDaemon
u0_a100 19431 19418 1609932 43208 ffffffff 00000000 S FinalizerWatchd
u0_a100 19432 19418 1609932 43208 ffffffff 00000000 S HeapTrimmerDaem
u0_a100 19433 19418 1609932 43208 ffffffff 00000000 S GCDaemon
u0_a100 19434 19418 1609932 43208 ffffffff 00000000 S Binder_1
u0_a100 19435 19418 1609932 43208 ffffffff 00000000 S Binder_2
u0_a100 19438 19418 1609932 43208 ffffffff 00000000 S android.bg
u0_a100 19464 19418 1609932 43208 ffffffff 00000000 S RenderThread
u0_a100 19465 19418 1609932 43208 ffffffff 00000000 S AsyncQueryWorke
u0_a100 19470 19418 1609932 43208 ffffffff 00000000 S GL updater
u0_a100 19474 19418 1609932 43208 ffffffff 00000000 S hwuiTask1

一个Hellow world App,包含至少2个Binder线程(偶尔出现3个),FinalizerDaemon线程、FinalizerWatchd线程、RenderThread、主线程、ReferenceQueued、HeapTaskDaemon、SignalCatcher、GCDaemon、hwuiTask

 

 

 

 

posted @ 2016-10-31 13:20  lipeil  阅读(9814)  评论(0编辑  收藏  举报