dumpsys命令

查看dump服务

通过命令

1
adb shell dumpsys -l

可查看该机器支持的所有dump服务:

(以nexus 5 Android 6.0为例)

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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
lcg@ubuntu:~$ adb shell dumpsys -l
Currently running services:
DockObserver
SurfaceFlinger
accessibility
account
activity
alarm
android.security.keystore
appops
appwidget
assetatlas
audio
backup
batterymanager
batteryproperties
batterystats
bluetooth_manager
carrier_config
clipboard
cmappsuggest
cmaudio
cmhardware
cmiconcache
cmlivedisplay
cmlivelockscreen
cmpartnerinterface
cmperformance
cmstatusbar
cmtelephonymanager
cmthemes
cmweather
commontime_management
connectivity
consumer_ir
content
country_detector
cpuinfo
dbinfo
device_policy
deviceidle
devicestoragemonitor
diskstats
display
display.qservice
dreams
drm.drmManager
dropbox
ethernet
fingerprint
gfxinfo
graphicsstats
imms
input
input_method
iphonesubinfo
isms
isub
jobscheduler
launcherapps
location
lock_settings
media.audio_flinger
media.audio_policy
media.camera
media.camera.proxy
media.player
media.radio
media.resource_manager
media.sound_trigger_hw
media_projection
media_router
media_session
meminfo
midi
mount
netpolicy
netstats
network_management
network_score
nfc
notification
package
permission
phone
power
print
processinfo
procstats
profile
restrictions
rttmanager
samplingprofiler
scheduling_policy
search
sensorservice
serial
servicediscovery
simphonebook
sip
statusbar
telecom
telephony.registry
textservices
trust
uimode
updatelock
usagestats
usb
user
vibrator
voiceinteraction
wallpaper
webviewupdate
wifi
wifip2p
wifiscanner
window

通过命令

1
service list

可进一步了解以上服务名具体对应的服务:

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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
shell@M1000:/ $ service list                                                   
Found 126 services:
0 GpuAppSpectatorService: [com.mediatek.GpuAppSpectatorService]
1 sip: [android.net.sip.ISipService]
2 telecom: [com.android.internal.telecom.ITelecomService]
3 carrier_config: [com.android.internal.telephony.ICarrierConfigLoader]
4 phoneEx: [com.mediatek.internal.telephony.ITelephonyEx]
5 phone: [com.android.internal.telephony.ITelephony]
6 isms: [com.android.internal.telephony.ISms]
7 iphonesubinfo: [com.android.internal.telephony.IPhoneSubInfo]
8 simphonebook: [com.android.internal.telephony.IIccPhoneBook]
9 isub: [com.android.internal.telephony.ISub]
10 GbaService: [com.mediatek.gba.IGbaService]
11 ims: [com.android.ims.internal.IImsService]
12 vie_command: [com.mediatek.common.voiceextension.IVoiceExtCommandManager]
13 imms: [com.android.internal.telephony.IMms]
14 media_projection: [android.media.projection.IMediaProjectionManager]
15 mtk-perfservice: [com.mediatek.perfservice.IPerfService]
16 launcherapps: [android.content.pm.ILauncherApps]
17 fingerprint: [android.hardware.fingerprint.IFingerprintService]
18 trust: [android.app.trust.ITrustManager]
19 media_router: [android.media.IMediaRouterService]
20 media_session: [android.media.session.ISessionManager]
21 restrictions: [android.content.IRestrictionsManager]
22 print: [android.print.IPrintManager]
23 graphicsstats: [android.view.IGraphicsStats]
24 assetatlas: [android.view.IAssetAtlas]
25 dreams: [android.service.dreams.IDreamManager]
26 commontime_management: []
27 samplingprofiler: []
28 diskstats: []
29 voiceinteraction: [com.android.internal.app.IVoiceInteractionManagerService]
30 appwidget: [com.android.internal.appwidget.IAppWidgetService]
31 backup: [android.app.backup.IBackupManager]
32 jobscheduler: [android.app.job.IJobScheduler]
33 serial: [android.hardware.ISerialManager]
34 usb: [android.hardware.usb.IUsbManager]
35 DockObserver: []
36 audioprofile: [com.mediatek.common.audioprofile.IAudioProfileService]
37 audio: [android.media.IAudioService]
38 wallpaper: [android.app.IWallpaperManager]
39 dropbox: [com.android.internal.os.IDropBoxManagerService]
40 search_engine: [com.mediatek.search.ISearchEngineManagerService]
41 search: [android.app.ISearchManager]
42 country_detector: [android.location.ICountryDetector]
43 location: [android.location.ILocationManager]
44 devicestoragemonitor: []
45 notification: [android.app.INotificationManager]
46 updatelock: [android.os.IUpdateLock]
47 data_shaping: [com.mediatek.datashaping.IDataShapingManager]
48 servicediscovery: [android.net.nsd.INsdManager]
49 connectivity: [android.net.IConnectivityManager]
50 ethernet: [android.net.IEthernetManager]
51 rttmanager: [android.net.wifi.IRttManager]
52 wifiscanner: [android.net.wifi.IWifiScanner]
53 wifi: [android.net.wifi.IWifiManager]
54 wifip2p: [android.net.wifi.p2p.IWifiP2pManager]
55 netpolicy: [android.net.INetworkPolicyManager]
56 netstats: [android.net.INetworkStatsService]
57 network_score: [android.net.INetworkScoreService]
58 textservices: [com.android.internal.textservice.ITextServicesManager]
59 network_management: [android.os.INetworkManagementService]
60 clipboard: [android.content.IClipboard]
61 statusbar: [com.android.internal.statusbar.IStatusBarService]
62 device_policy: [android.app.admin.IDevicePolicyManager]
63 deviceidle: [android.os.IDeviceIdleController]
64 persistent_data_block: [android.service.persistentdata.IPersistentDataBlockService]
65 lock_settings: [com.android.internal.widget.ILockSettings]
66 uimode: [android.app.IUiModeManager]
67 mount: [IMountService]
68 accessibility: [android.view.accessibility.IAccessibilityManager]
69 input_method: [com.android.internal.view.IInputMethodManager]
70 bluetooth_manager: [android.bluetooth.IBluetoothManager]
71 input: [android.hardware.input.IInputManager]
72 window: [android.view.IWindowManager]
73 alarm: [android.app.IAlarmManager]
74 consumer_ir: [android.hardware.IConsumerIrService]
75 vibrator: [android.os.IVibratorService]
76 mobile: [com.mediatek.common.mom.IMobileManagerService]
77 content: [android.content.IContentService]
78 account: [android.accounts.IAccountManager]
79 media.camera.proxy: [android.hardware.ICameraServiceProxy]
80 telephony.registry: [com.android.internal.telephony.ITelephonyRegistry]
81 scheduling_policy: [android.os.ISchedulingPolicyService]
82 webviewupdate: [android.webkit.IWebViewUpdateService]
83 usagestats: [android.app.usage.IUsageStatsManager]
84 battery: []
85 sensorservice: [android.gui.SensorServer]
86 anrmanager: [android.app.IANRManager]
87 processinfo: [android.os.IProcessInfoService]
88 permission: [android.os.IPermissionController]
89 cpuinfo: []
90 dbinfo: []
91 gfxinfo: []
92 meminfo: []
93 procstats: [com.android.internal.app.IProcessStats]
94 activity: [android.app.IActivityManager]
95 user: [android.os.IUserManager]
96 package: [android.content.pm.IPackageManager]
97 recovery: [com.mediatek.recovery.IRecoveryManagerService]
98 display: [android.hardware.display.IDisplayManager]
99 power: [android.os.IPowerManager]
100 appops: [com.android.internal.app.IAppOpsService]
101 batterystats: [com.android.internal.app.IBatteryStats]
102 media.mmsdk: [com.mediatek.mmsdk.IMMSdkService]
103 media.radio: [android.hardware.IRadioService]
104 media.sound_trigger_hw: [android.hardware.ISoundTriggerHwService]
105 media.audio_policy: [android.media.IAudioPolicyService]
106 media.camera: [android.hardware.ICameraService]
107 user.xposed.app: [com.eebbk.studyos.alpaca.IXposedService]
108 user.xposed.system: [com.eebbk.studyos.alpaca.IXposedService]
109 media.VTS: [android.hardware.IVTService]
110 SurfaceFlinger: [android.ui.ISurfaceComposer]
111 drm.drmManager: [drm.IDrmManagerService]
112 memory_dumper: [android.memory.IMemoryDumper]
113 media.resource_manager: [android.media.IResourceManagerService]
114 media.player: [android.media.IMediaPlayerService]
115 media.audio_flinger: [android.media.IAudioFlinger]
116 program_binary: []
117 android.security.keystore: [android.security.IKeystoreService]
118 batteryproperties: [android.os.IBatteryPropertiesRegistrar]
119 android.service.gatekeeper.IGateKeeperService: []
120 GuiExtService: [GuiExtService]
121 DmAgent: []
122 PQ: [PQService]
123 mtk.codecservice: []
124 PPLAgent: []
125 NvRAMAgent: [NvRAMAgent]

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
29
shell@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. //过滤,只显示该包名

热评文章