什么是Android的ADB壳QUOT; dumpsys"工具,什么是它的好处? [英] What's the Android ADB shell "dumpsys" tool and what are its benefits?

查看:152
本文介绍了什么是Android的ADB壳QUOT; dumpsys"工具,什么是它的好处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找亚行壳 dumpsys 的所有命令的完整说明命令。

I'm looking for the full list of ADB shell dumpsys commands with a full explanation of all of the commands.

我在哪里可以找到这些信息?

Where can I find this information?

推荐答案

什么是dumpsys,什么是它的好处

dumpsys 的是运行在设备上,对转储系统服务的状态有趣的信息的机器人的工具。

dumpsys is an android tool that runs on the device and dumps interesting information about the status of system services.

好处显而易见:

  1. 的可能性很容易得到一个简单的字符串重新presentation系统信息。
  2. 可能使用甩了CPU,内存,电池,存储统计数据的 pretty的图表,这将让你检查应用程序 影响整个设备!
  1. Possibility to easily get system information in a simple string representation.
  2. Possibility to use dumped CPU, RAM, Battery, storage stats for a pretty charts, which will allow you to check how your application affects the overall device!

我们可以从dumpsys shell命令获取哪些信息,以及我们如何使用它

如果您运行dumpsys你会看到大量的系统信息。但是你可以使用这个自动倾卸大只独立的部分。

If you run dumpsys you would see a ton of system information. But you can use only separate parts of this big dump.

要看到所有的dumpsys的子做的:

to see all of the "subcommands" of dumpsys do:

dumpsys | grep的DUMP服务

输出:

DUMP OF SERVICE SurfaceFlinger:
DUMP OF SERVICE accessibility:
DUMP OF SERVICE account:
DUMP OF SERVICE activity:
DUMP OF SERVICE alarm:
DUMP OF SERVICE appwidget:
DUMP OF SERVICE audio:
DUMP OF SERVICE backup:
DUMP OF SERVICE battery:
DUMP OF SERVICE batteryinfo:
DUMP OF SERVICE clipboard:
DUMP OF SERVICE connectivity:
DUMP OF SERVICE content:
DUMP OF SERVICE cpuinfo:
DUMP OF SERVICE device_policy:
DUMP OF SERVICE devicestoragemonitor:
DUMP OF SERVICE diskstats:
DUMP OF SERVICE dropbox:
DUMP OF SERVICE entropy:
DUMP OF SERVICE hardware:
DUMP OF SERVICE input_method:
DUMP OF SERVICE iphonesubinfo:
DUMP OF SERVICE isms:
DUMP OF SERVICE location:
DUMP OF SERVICE media.audio_flinger:
DUMP OF SERVICE media.audio_policy:
DUMP OF SERVICE media.player:
DUMP OF SERVICE meminfo:
DUMP OF SERVICE mount:
DUMP OF SERVICE netstat:
DUMP OF SERVICE network_management:
DUMP OF SERVICE notification:
DUMP OF SERVICE package:
DUMP OF SERVICE permission:
DUMP OF SERVICE phone:
DUMP OF SERVICE power:
DUMP OF SERVICE reboot:
DUMP OF SERVICE screenshot:
DUMP OF SERVICE search:
DUMP OF SERVICE sensor:
DUMP OF SERVICE simphonebook:
DUMP OF SERVICE statusbar:
DUMP OF SERVICE telephony.registry:
DUMP OF SERVICE throttle:
DUMP OF SERVICE usagestats:
DUMP OF SERVICE vibrator:
DUMP OF SERVICE wallpaper:
DUMP OF SERVICE wifi:
DUMP OF SERVICE window:

倾销的一些例子和输出

1)让所有可能的电池统计:

1) Getting all possible battery statistic:

$~ adb shell dumpsys battery

您会得到输出:

Current Battery Service state:
AC powered: false
AC capacity: 500000
USB powered: true
status: 5
health: 2
present: true
level: 100
scale: 100
voltage:4201
temperature: 271 <---------- Battery temperature! %)
technology: Li-poly <---------- Battery technology! %)

2)获取无线网络信息

2)Getting wifi informations

~$ adb shell dumpsys wifi

输出:

Wi-Fi is enabled
Stay-awake conditions: 3

Internal state:
interface tiwlan0 runState=Running
SSID: XXXXXXX BSSID: xx:xx:xx:xx:xx:xx, MAC: xx:xx:xx:xx:xx:xx, Supplicant state: COMPLETED, RSSI: -60, Link speed: 54, Net ID: 2, security: 0, idStr: null
ipaddr 192.168.1.xxx gateway 192.168.x.x netmask 255.255.255.0 dns1 192.168.x.x dns2 8.8.8.8 DHCP server 192.168.x.x lease 604800 seconds
haveIpAddress=true, obtainingIpAddress=false, scanModeActive=false
lastSignalLevel=2, explicitlyDisabled=false

Latest scan results:

Locks acquired: 28 full, 0 scan
Locks released: 28 full, 0 scan

Locks held:

3)获取CPU信息

3) Getting CPU info

~$ adb shell dumpsys cpuinfo

输出:

Load: 0.08 / 0.4 / 0.64
CPU usage from 42816ms to 34683ms ago:
system_server: 1% = 1% user + 0% kernel / faults: 16 minor
kdebuglog.sh: 0% = 0% user + 0% kernel / faults: 160 minor
tiwlan_wq: 0% = 0% user + 0% kernel
usb_mass_storag: 0% = 0% user + 0% kernel
pvr_workqueue: 0% = 0% user + 0% kernel
+sleep: 0% = 0% user + 0% kernel
+sleep: 0% = 0% user + 0% kernel
TOTAL: 6% = 1% user + 3% kernel + 0% irq

4)获取内存使用信息

4)Getting memory usage informations

~$ adb shell dumpsys meminfo 'your apps package name'

输出:

** MEMINFO in pid 5527 [com.sec.android.widgetapp.weatherclock] **
                    native   dalvik    other    total
            size:     2868     5767      N/A     8635
       allocated:     2861     2891      N/A     5752
            free:        6     2876      N/A     2882
           (Pss):      532       80     2479     3091
  (shared dirty):      932     2004     6060     8996
    (priv dirty):      512       36     1872     2420

 Objects
           Views:        0        ViewRoots:        0
     AppContexts:        0       Activities:        0
          Assets:        3    AssetManagers:        3
   Local Binders:        2    Proxy Binders:        8
Death Recipients:        0
 OpenSSL Sockets:        0


 SQL
               heap:        0         MEMORY_USED:        0
 PAGECACHE_OVERFLOW:        0         MALLOC_SIZE:        0

如果你想看到的信息的所有进程,使用〜$亚行外壳dumpsys meminfo中

If you want see the info for all processes, use ~$ adb shell dumpsys meminfo

dumpsys 最终是灵活的和有用的工具!

dumpsys is ultimately flexible and useful tool!

如果你想使用这个工具不要忘了自动添加权限到你的Andr​​oid清单 android.permission.DUMP

If you want to use this tool do not forget to add permission into your android manifest automatically android.permission.DUMP

尝试测试所有命令更多地了解dumpsys。快乐倾倒!

Try to test all commands to learn more about dumpsys. Happy dumping!

这篇关于什么是Android的ADB壳QUOT; dumpsys&QUOT;工具,什么是它的好处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆