[TOC]

概述

​ ADB命令之dumpsys的命令是用来查看系统服务相关信息。

​ adb shell dumpsys命令是用于打印出当前系统信息(更切确的说是dumpsys命令,因为adb shell只是为了进入手机或模拟器的shell内核,使其能够执行dumpsys命令),可以在命令后面加指定的service name(比如activity,location),如果不加则默认打印出设备中所有service的信息.

​ 在adb shell dumpsys后面可添加的service name可通过adb shell dumpsys或adb shell service list方法获取.

adb shell dumpsys

​ 输出信息的开始部分就是所有运行的service,如下:

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
129
130
131
Currently running services:
DmAgent
DockObserver
GuiExtService
IIccPhoneBookMz
NvRAMAgent
PPLAgent
SurfaceFlinger
access_control
accessibility
account
activity
alarm
alphame_server
android.security.keystore
anrmanager
appops
appwidget
audio
backup
battery
batteryproperties
batterystats
bluetooth_manager
clipboard
commontime_management
connectivity
consumer_ir
content
country_detector
cpuinfo
dbinfo
device_control
device_policy
device_states
devicestoragemonitor
diskstats
display
dreams
drm.drmManager
dropbox
entropy
fingerprint
fingerprints_service
flyme_error_report_manager
flyme_novccusagestats
flyme_packagemanager
flyme_permission
flyme_splitmode
flyme_statusbar
flyme_theme_service
flyme_wallpaper
gesture_manager
gfxinfo
hardware
hips_service
imms
input
input_method
iphonesubinfo
isms
isub
jobscheduler
launcherapps
location
lock_settings
media.audio_flinger
media.audio_policy
media.camera
media.mmsdk
media.player
media.sound_trigger_hw
media_projection
media_router
media_session
meizu.camera
meminfo
memory_dumper
mobile
mount
move_window
mtk-perfservice
mtk.codecservice
netpolicy
netstats
network_management
network_score
networkmanagement_service_flyme
notification
package
permission
phone
phoneEx
phone_ext
power
pppoe
print
procstats
program_binary
recovery
restrictions
rttmanager
samba_client
samba_server
samplingprofiler
scheduling_policy
search
search_engine
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
2
3
4
5
6
7
8
9
10
11
12
13
14
adb shell dumpsys --help


// 查看Activity的相关信息(输入包名则查看具体包名的Activity信息):
adb shell dumpsys activity <package_name>

// 查看CPU相关信息
adb shell dumpsys cpuinfo

// 查看电池使用信息
adb shell dumpsys battery

//查看Window的相关信息,最后部分可以看到分辨率的信息
adb shell dumpsys window