【转】adb shell dumpsys

adb shell dumpsys

 

dumpsys是用来打印系统中指定服务的信息

 

Also you can apply filters to running services:

1 SurfaceFlinger

2 accessibility

3 account

4 activity

5 alarm

6 appwidget

7 audio

8 backup

9 battery

10 batteryinfo

11 bluetooth

12 bluetooth_a2dp

13 clipboard

14 connectivity

15 content

16 cpuinfo

17 device_policy

18 devicestoragemonitor

19 diskstats

20 dropbox

21 entropy

22 ethernet

23 hardware

24 input_method

25 iphonesubinfo

26 isms

27 keybar

28 location

29 media.audio_flinger

30 media.audio_policy

31 media.camera

32 media.player

33 meminfo

34 mount

35 netstat

36 network_management

37 notification

38 package

39 permission

40 phone

41 power

42 search

43 sensorservice

44 simphonebook

45 statusbar

46 telephony.registry

47 throttle

48 uimode

49 usagestats

50 vibrator

51 wallpaper

52 wifi

53 window

Some examples:

adb shell dumpsys wifi

adb shell dumpsys cpuinfo

 

 dump方法的重写:

       dumpsys的代码在mydroid/frameworks/base/cmds/dumpsys/dumpsys.cpp
    所有的dump信息都是由重载了Binder中的dump函数的类来完成:
        @Override
        protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
            ...
        }

      比如DiskStatsService,重写dump方法,利用 pw自带的pw.print("")函数,就能用dumpsys来进行shell打印了。

      public class DiskStatsService extands Binder

 

转自:http://quanminchaoren.iteye.com/category/130059

你可能感兴趣的:(shell)