dumpsys命令实在是太强大了,包含了太多的命令,这篇文档我打算一点点的写。
命令概要
dumpsys在源码的/frameworks/native/cmds/dumpsys目录
在这么多命令中,我比较常用的有
dumpsys activity
dumpsys activity
执行dumpsys activity -h可以看到如下帮助文档
chiron:/ # dumpsys activity -h
Activity manager dump options:
[-a] [-c] [-p PACKAGE] [-h] [WHAT] ...
WHAT may be one of:
a[ctivities]: activity stack state
r[recents]: recent activities state
b[roadcasts] [PACKAGE_NAME] [history [-s]]: broadcast state
broadcast-stats [PACKAGE_NAME]: aggregated broadcast statistics
i[ntents] [PACKAGE_NAME]: pending intent state
p[rocesses] [PACKAGE_NAME]: process state
o[om]: out of memory management
perm[issions]: URI permission grant state
prov[iders] [COMP_SPEC ...]: content provider state
provider [COMP_SPEC]: provider client-side state
s[ervices] [COMP_SPEC ...]: service state
as[sociations]: tracked app associations
settings: currently applied config settings
service [COMP_SPEC]: service client-side state
package [PACKAGE_NAME]: all state related to given package
all: dump all activities
top: dump the top activity
WHAT 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.
--checkin: output checkin format, resetting data.
--C: output checkin format, not resetting data.
使用实例
dumpsys activity -p com.ss.android.article.news services // 查看service状态
dumpsys activity | grep mResumedActivity // 查看显示的activity
dumpsys所有命令
使用dumpsys -l
可以查看所有的子命令
可以看到支持的命令有这么多:
Currently running services:
DockObserver
MiuiBackup
MiuiInit
ProcessManager
SurfaceFlinger
accessibility
account
activity
alarm
android.security.keystore
android.service.gatekeeper.IGateKeeperService
appops
appwidget
audio
autofill
backup
battery
batteryproperties
batterystats
bluetooth_manager
carrier_config
clipboard
cneservice
com.goodix.FingerprintService
com.qualcomm.location.izat.IzatService
commontime_management
companiondevice
connectivity
connmetrics
consumer_ir
content
contexthub
country_detector
cpuinfo
dbinfo
device_identifiers
device_policy
deviceidle
devicestoragemonitor
diskstats
display
dpmservice
dreams
drm.drmManager
dropbox
ethernet
extphone
fingerprint
gfxinfo
gpu
graphicsstats
hardware_properties
imms
input
input_method
installd
iphonesubinfo
isms
isub
jobscheduler
launcherapps
location
locationpolicy
lock_settings
media.audio_flinger
media.audio_policy
media.camera
media.camera.proxy
media.cas
media.drm
media.extractor
media.metrics
media.player
media.radio
media.resource_manager
media.sound_trigger_hw
media_projection
media_resource_monitor
media_router
media_session
meminfo
midi
miui.contentcatcher.ContentCatcherService
miui.face.FaceService
miui.fdpp
miui.mqsas.IMQSNative
miui.mqsas.MQSService
miui.sedc
miui.shell
miui.whetstone.klo
miui.whetstone.mcd
miui.whetstone.power
mount
netd
netd_listener
netpolicy
netstats
network_management
network_score
network_time_update_service
nfc
notification
oem_lock
otadexopt
overlay
package
perfshielder
permission
persistent_data_block
phone
pinner
power
print
processinfo
procstats
qti.ims.ext
recovery
restrictions
rttmanager
samplingprofiler
scheduling_policy
search
sec_key_att_app_id_provider
security
sensorservice
serial
servicediscovery
settings
shortcut
simphonebook
sip
sms-sec
soundtrigger
statusbar
storaged
storagestats
telecom
telephony.registry
textservices
trust
uimode
updatelock
usagestats
usb
user
vibrator
voiceinteraction
vrmanager
wallpaper
webviewupdate
whetstone.activity
wifi
wificond
wifip2p
wifiscanner
window
xiaomi.joyose
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!