Android

01dumpsys命令分析:dumpsys命令的功能

2018-11-13  本文已影响16人  泽洛灬
dumpsys命令是什么:

先来看一下官方对dumpsys的描述:

dumpsys is a tool that runs on Android devices and provides information about system services.

We can use dumpsys to accomplish common tasks, such as inspecting input, RAM, battery, or network diagnostics.

可以看到dumpsys是android系统提供的和系统服务打交道的工具,甚至可以直接改变系统服务的某些状态值,官方列举了几个常见的任务:检查输入,RAM,电池或网络诊断。

dumpsys命令怎么用:

adb shell dumpsys --help

usage: dumpsys ​ To dump all services. or: ​ dumpsys -t TIMEOUT] ​ --help: shows this help ​ -l: only list services, do not dump them ​ -t TIMEOUT: TIMEOUT to use in seconds instead of default 10 seconds ​ --skip SERVICES: dumps all services but SERVICES (comma-separated list) ​ SERVICE [ARGS]: dumps only service SERVICE, optionally passing ARGS to it

举例:

adb shell dumpsys activity activities | grep mFocusedActivity

adb shell dumpsys battery

adb shell dumpsys meminfo com.android.settings

上一篇下一篇

猜你喜欢

热点阅读