dumpsys命令的用法

原创 2015年07月10日 16:28:22
  • dumpsys命令是android手机自带的调试工具,下面详解讲解dumpsys用法

一. 初识dumpsys

adb shell                         //进入手机shell
dumpsys | grep "DUMP OF SERVICE"  //列举当前手机所有支持的dumpsys命令

运行上面指令,结果(不同手机结果会有所差异)

DUMP OF SERVICE AppIconThemeServices:
DUMP OF SERVICE AtCmdFwd:
DUMP OF SERVICE DockObserver:
DUMP OF SERVICE SurfaceFlinger:
DUMP OF SERVICE accessibility:
DUMP OF SERVICE account:
DUMP OF SERVICE activity:
DUMP OF SERVICE alarm:
DUMP OF SERVICE android.security.keystore:
DUMP OF SERVICE appops:
DUMP OF SERVICE appwidget:
DUMP OF SERVICE assetatlas:
DUMP OF SERVICE audio:
DUMP OF SERVICE backup:
DUMP OF SERVICE battery:
DUMP OF SERVICE batteryproperties:
DUMP OF SERVICE batterystats:
DUMP OF SERVICE bluetooth_manager:
DUMP OF SERVICE clipboard:
DUMP OF SERVICE com.broadcom.nfc.Factory:
DUMP OF SERVICE com.qualcomm.qti.auth.fidocryptodaemon:
DUMP OF SERVICE commontime_management:
DUMP OF SERVICE connectivity:
DUMP OF SERVICE consumer_ir:
DUMP OF SERVICE content:
DUMP OF SERVICE country_detector:
DUMP OF SERVICE cpuinfo:
DUMP OF SERVICE dbinfo:
DUMP OF SERVICE device_policy:
DUMP OF SERVICE devicestoragemonitor:
DUMP OF SERVICE diskstats:
DUMP OF SERVICE display:
DUMP OF SERVICE display.qservice:
DUMP OF SERVICE dreams:
DUMP OF SERVICE drm.drmManager:
DUMP OF SERVICE dropbox:
DUMP OF SERVICE entropy:
DUMP OF SERVICE fingerprint:
DUMP OF SERVICE fm_fingerprint_service:
DUMP OF SERVICE gfxinfo:
DUMP OF SERVICE hardware:
DUMP OF SERVICE imms:
DUMP OF SERVICE ims:
DUMP OF SERVICE input:
DUMP OF SERVICE input_method:
DUMP OF SERVICE iphonesubinfo:
DUMP OF SERVICE isms:
DUMP OF SERVICE isub:
DUMP OF SERVICE jobscheduler:
DUMP OF SERVICE karaoke:
DUMP OF SERVICE launcherapps:
DUMP OF SERVICE lenovopermission:
DUMP OF SERVICE location:
DUMP OF SERVICE lock_settings:
DUMP OF SERVICE media.audio_flinger:
DUMP OF SERVICE media.audio_policy:
DUMP OF SERVICE media.camera:
DUMP OF SERVICE media.player:
DUMP OF SERVICE media.sound_trigger_hw:
DUMP OF SERVICE media_projection:
DUMP OF SERVICE media_router:
DUMP OF SERVICE media_session:
DUMP OF SERVICE meminfo:
DUMP OF SERVICE mount:
DUMP OF SERVICE netpolicy:
DUMP OF SERVICE netstats:
DUMP OF SERVICE network_management:
DUMP OF SERVICE network_score:
DUMP OF SERVICE nfc:
DUMP OF SERVICE notification:
DUMP OF SERVICE package:
rUMP OF SERVICE permission:
DUMP OF SERVICE phone:
DUMP OF SERVICE power:
DUMP OF SERVICE print:
DUMP OF SERVICE procstats:
DUMP OF SERVICE qti.ims.connectionmanagerservice:
DUMP OF SERVICE restrictions:
DUMP OF SERVICE rttmanager:
DUMP OF SERVICE samplingprofiler:
DUMP OF SERVICE scheduling_policy:
DUMP OF SERVICE search:
DUMP OF SERVICE sensorservice:
DUMP OF SERVICE serial:
DUMP OF SERVICE servicediscovery:
DUMP OF SERVICE simphonebook:
DUMP OF SERVICE sip:
DUMP OF SERVICE start_shutdown:
DUMP OF SERVICE statusbar:
DUMP OF SERVICE telecom:
DUMP OF SERVICE telephony.registry:
DUMP OF SERVICE textservices:
DUMP OF SERVICE trust:
DUMP OF SERVICE uimode:
DUMP OF SERVICE updatelock:
DUMP OF SERVICE usagestats:
DUMP OF SERVICE usb:
DUMP OF SERVICE user:
DUMP OF SERVICE vendor.qcom.PeripheralManager:
DUMP OF SERVICE vibrator:
DUMP OF SERVICE voiceinteraction:
DUMP OF SERVICE wallpaper:
DUMP OF SERVICE wbc_service:
DUMP OF SERVICE webviewupdate:
DUMP OF SERVICE wfdservice:
DUMP OF SERVICE wifi:
DUMP OF SERVICE wifip2p:
DUMP OF SERVICE wifiscanner:
DUMP OF SERVICE window:

二. dumpsys用法

(1)前面输入每一行都是都可以组成一条dumpsys指令。例如:DUMP OF SERVICE meminfo

dumpsys meminfo    //输出当前所有memory相关的信息

(2)当我们想查看具体某个应用的内存使用情况,例如QQ:

dumpsys meminfo com.tencent.mobileqq

运行结果:

Applications Memory Usage (kB):
Uptime: 7382804 Realtime: 7382804

** MEMINFO in pid 22590 [com.tencent.mobileqq] **
                   Pss  Private  Private  Swapped     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------
  Native Heap     8701     8416        0        0    16384    10626     5757
  Dalvik Heap    10247     6548        0        0    37655    22685    14970
 Dalvik Other      633      632        0        0
        Stack      820      820        0        0
      Gfx dev       68       68        0        0
    Other dev       25        0       24        0
     .so mmap     5365      164     3236        0
    .apk mmap      564        0      360        0
    .ttf mmap      378        0       60        0
    .dex mmap     5690        0     4368        0
    .oat mmap     2711        0      272        0
    .art mmap     2825     1596       12        0
   Other mmap       52        4        0        0
      Unknown      151      140        0        0
        TOTAL    38230    18388     8332        0    54039    33311    20727

 Objects
               Views:        8         ViewRootImpl:        1
         AppContexts:        3           Activities:        1
              Assets:        3        AssetManagers:        3
       Local Binders:       23        Proxy Binders:       23
       Parcel memory:        9         Parcel count:       39
    Death Recipients:        2      OpenSSL Sockets:        0

 SQL
         MEMORY_USED:        0
  PAGECACHE_OVERFLOW:        0          MALLOC_SIZE:       62

(3)帮助信息

dumpsys meminfo -h  //此处以meminfo为例,其他指令也是类同

运行结果

meminfo dump options: [-a] [-d] [-c] [--oom] [process]
  -a: include all available information for each process.
  -d: include dalvik details when dumping process details.
  -c: dump in a compact machine-parseable representation.
  --oom: only show processes organized by oom adj.
  --local: only collect details locally, don't call process.
  --package: interpret process arg as package, dumping all
             processes that have loaded that package.
If [process] is specified it can be the name or
pid of a specific process to dump.

三. dumpsys常用指令

dumpsys指令很多, 下面列举一些常用的dumpsys指令的功能


 dumpsys package  <package_name>   //查看指定包名的信息
 dumpsys activity <package_name>  //查看指定包名的activity信息

 dumpsys alarm      //查看Alarm信息
 dumpsys audio      //查看声音信息
 dumpsys battery    //查看电池信息
 dumpsys cpuinfo //查看CPU信息
 dumpsys meminfo  <package_name>//查看指定包名的内存信息
 dumpsys netstats//查看网络统计信息
 dumpsys diskstats   //查看空间free状态
 dumpsys jobscheduler   //查看任务计划
 dumpsys power//查看功耗信息
 dumpsys wifi//查看wifi信息

相关文章推荐

dumpsys使用详解

Dumpsys结构图:   实现方式: dumpsys的代码在mydroid/frameworks/base/cmds/dumpsys/dumpsys.cpp,所有的dump信息都是...
  • Anlegor
  • Anlegor
  • 2014年08月15日 12:24
  • 23240

dumpsys工具使用

dumpsys工具使用 我们知道Android使用ServiceManager服务进程来管理系统所有的服务,在系统启动时,每个服务必须注册到ServiceManager进程中,那如何查看系统运行了那...

dumpsys命令用法

dumpsys命令功能很强大,能dump系统服务的各种状态,非常有必要熟悉该命令的用法以及含义。 一、 dumpsys命令 1.1 服务列表 不同的Android系统版本支持的命令有所不同,...

Android开发工具—adb shell命令—dumpsys

查找当前应用activity方法 1 、cmd窗口中执行“adb logcat -v time -s ActivityManager > d:\log.txt” 抓logcat ,进入相应的acti...

Android 性能优化 五 性能分析工具dumpsys的使用

Android提供的dumpsys工具可以用于查看感兴趣的系统服务信息与状态,手机连接电脑后可以直接命令行执行adb shell dumpsys 查看所有支持的Service但是这样输出的太多,可以通...

Android调试系列之dumpsys命令

可以直接执行dumpsys命令,会将所有的结果列出来。但是得到的结果太多,不容易拿到有效的信息。...

Android:dumpsys功能之一:原理介绍

描述Android中dumpsys的功能实现原理

Android 性能分析工具dumpsys的使用

Android提供的dumpsys工具可以用于查看感兴趣的系统服务信息与状态,手机连接电脑后可以直接命令行执行adb shell dumpsys 查看所有支持的Service但是这样输出的太多,可以通...
  • ljchlx
  • ljchlx
  • 2016年06月22日 18:03
  • 883

dumpsys使用详解

以下文章转自http://blog.csdn.net/anlegor/article/details/38583235,仅供学习需要 Dumpsys结构图:   实现方式...

Android实战技巧之十六:getprop与dumpsys命令

Android设备连接PC后,我们可以通过adb命令完成绝大多数工作。下面借助getprop、dumpsys来了解一些系统相关信息。一、getprop此命令的原理很简单,就是从系统的各种配置文件中读取...
  • lincyang
  • lincyang
  • 2015年03月11日 14:38
  • 14145
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:dumpsys命令的用法
举报原因:
原因补充:

(最多只允许输入30个字)