Android Shell命令dumpsys
dumpsys命令可以显示手机中所有应用程序的信息,并且也会给出现在手机的状态。
直接执行adb shell dumpsys
会显示以下所有信息。
SurfaceFlinger, accessibility, account, activity, alarm, appwidget, audio, backup, battery, batteryinfo, bluetooth, bluetooth_a2dp, clipboard, connectivity, content, cpuinfo, device_policy, devicestoragemonitor, diskstats, dropbox, entropy, hardware, hdmi, input_method, iphonesubinfo, isms, location, media.audio_flinger, media.audio_policy, media.camera, media.player, meminfo, mount, netstat, network_management, notification, package, permission, phone, power, search, sensor, simphonebook, statusbar, telephony.registry, throttle, uimode, usagestats, vibrator, wallpaper, wifi, window
dumpsys的参数可以跟以上信息的名字。例如: |
adb shell dumpsys activity
显示activity相关的信息
adb shell dumpsys statusbar
显示状态栏相关的信息
adb shell dumpsys meminfo package_name or pid
使用程序的包名或者进程id显示内存信息
可以通过这个命令,可以查看内存信息,状态栏的通知是哪个应用谈出来的等等。
其实就一条shell命令:
adb shell dumpsys statusbar grep notification=Notification
这条命令可以找出状态栏通知的包名,进而找到是哪个应用。