查看dump服务
通过命令1
adb shell dumpsys -l
可查看该机器支持的所有dump服务:
(以nexus 5 Android 6.0为例)
1 | lcg@ubuntu:~$ adb shell dumpsys -l |
通过命令1
service list
可进一步了解以上服务名具体对应的服务:
1 | shell@M1000:/ $ service list |
dumpsys activity
通过命令1
dumpsys activity -h
可查看所有参数1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29shell@M1000:/ $ dumpsys activity -h
Activity manager dump options:
[-a] [-c] [-p package] [-h] [cmd] ...
cmd may be one of:
a[ctivities]: activity stack state //activity 栈状态
r[recents]: recent activities state //最近使用Activity状态
b[roadcasts] [PACKAGE_NAME] [history [-s]]: broadcast state //广播状态
i[ntents] [PACKAGE_NAME]: pending intent state // Pending intent状态
p[rocesses] [PACKAGE_NAME]: process state //进程状态
o[om]: out of memory management // OOM信息
perm[issions]: URI permission grant state //授权状态
prov[iders] [COMP_SPEC ...]: content provider state //ContentProvider状态
provider [COMP_SPEC]: provider client-side state //ContentProvider(客户端)状态
s[ervices] [COMP_SPEC ...]: service state //服务状态
as[sociations]: tracked app associations
service [COMP_SPEC]: service client-side state //服务(客户端)状态
package [PACKAGE_NAME]: all state related to given package //所有与给予包名相关的状态
all: dump all activities //所有的activities信息
top: dump the top activity //栈顶activity信息
write: write all pending state to storage //状态持久化到存储
track-associations: enable association tracking //
untrack-associations: disable and clear association tracking
cmd may also be a COMP_SPEC to dump activities.
COMP_SPEC may be a component name (com.foo/.myApp),
a partial substring in a component name, a
hex object identifier.
-a: include all available server state. //列出所有可用的服务状态
-c: include client state. //列出客户端状态
-p: limit output to given package. //过滤,只显示该包名