前言

项目中有用[adb shell dumpsys],虽然记住几个常用的,但不常用的就很难记住,最近看到相关文章介绍,因此摘抄于此。

好记性不如烂笔头

正文

查看可以dump的service

使用命令

adb shell service list 

就出现如下:

Found 74 services: 0 bluetoothMM: [vendor.mtk.bt.adp.ashm] 1 dreams: [android.service.dreams.IDreamManager] 2 commontime_management: [] 3 DvdManagerService: [android.dvp.IDvdManagerService] 4 inputsource: [android.inputsource.IInputSourceService] 5 samplingprofiler: [] 6 diskstats: [] 7 appwidget: [com.android.internal.appwidget.IAppWidgetService] 8 backup: [android.app.backup.IBackupManager] 9 uimode: [android.app.IUiModeManager] 10 serial: [android.hardware.ISerialManager] 11 usb: [android.hardware.usb.IUsbManager] 12 audio: [android.media.IAudioService] 13 wallpaper: [android.app.IWallpaperManager] 14 dropbox: [com.android.internal.os.IDropBoxManagerService] 15 search: [android.app.ISearchManager] 16 country_detector: [android.location.ICountryDetector] 17 location: [android.location.ILocationManager] 18 devicestoragemonitor: [] 19 notification: [android.app.INotificationManager] 20 updatelock: [android.os.IUpdateLock] 21 throttle: [android.net.IThrottleManager] 22 servicediscovery: [android.net.nsd.INsdManager] 23 connectivity: [android.net.IConnectivityManager] 24 wifi: [android.net.wifi.IWifiManager] 25 wifip2p: [android.net.wifi.p2p.IWifiP2pManager] 26 netpolicy: [android.net.INetworkPolicyManager] 27 netstats: [android.net.INetworkStatsService] 28 textservices: [com.android.internal.textservice.ITextServicesManager] 29 network_management: [android.os.INetworkManagementService] 30 clipboard: [android.content.IClipboard] 31 statusbar: [com.android.internal.statusbar.IStatusBarService] 32 device_policy: [android.app.admin.IDevicePolicyManager] 33 lock_settings: [com.android.internal.widget.ILockSettings] 34 mount: [IMountService] 35 accessibility: [android.view.accessibility.IAccessibilityManager] 36 input_method: [com.android.internal.view.IInputMethodManager] 37 mcu: [android.mcu.IMcuManager] 38 savedataservice: [com.yecon.savedata.ISaveDataService] 39 bluetooth_profile_manager: [android.bluetooth.IBluetoothProfileManager] 40 bluetooth_socket: [android.bluetooth.IBluetoothSocket] 41 bluetooth: [android.bluetooth.IBluetooth] 42 input: [android.hardware.input.IInputManager] 43 window: [android.view.IWindowManager] 44 alarm: [android.app.IAlarmManager] 45 cbm: [android.cbm.ICBMService] 46 vibrator: [android.os.IVibratorService] 47 battery: [] 48 hardware: [android.os.IHardwareService] 49 content: [android.content.IContentService] 50 account: [android.accounts.IAccountManager] 51 user: [android.os.IUserManager] 52 permission: [android.os.IPermissionController] 53 cpuinfo: [] 54 dbinfo: [] 55 gfxinfo: [] 56 meminfo: [] 57 activity: [android.app.IActivityManager] 58 package: [android.content.pm.IPackageManager] 59 scheduling_policy: [android.os.ISchedulingPolicyService] 60 telephony.registry: [com.android.internal.telephony.ITelephonyRegistry] 61 display: [android.hardware.display.IDisplayManager] 62 usagestats: [com.android.internal.app.IUsageStats] 63 batteryinfo: [com.android.internal.app.IBatteryStats] 64 power: [android.os.IPowerManager] 65 entropy: [] 66 sensorservice: [android.gui.SensorServer] 67 media.divxctrl: [android.media.divxctrl] 68 media.audio_policy: [android.media.IAudioPolicyService] 69 media.camera: [android.hardware.ICameraService] 70 media.player: [android.media.IMediaPlayerService] 71 media.audio_flinger: [android.media.IAudioFlinger] 72 drm.drmManager: [drm.IDrmManagerService] 73 SurfaceFlinger: [android.ui.ISurfaceComposer] 

也就是说,上面的服务都可以dumpsys的。

dumpsys举例

cpuinfo
adb shell dumpsys cpuinfo 
Window
adb shell dumpsys window 

我经常用的是获取当前窗口的window

adb shell dumpsys window | grep mFocusedWindow 
media.audio_flinger
adb shell dumpsys media.audio_flinger 

等等,具体自己试验吧。

参考文章

  1. adb shell dumpsys 调出当前系统信息

暂无评论

评论审核已启用。您的评论可能需要一段时间后才能被显示。

none
暂无评论...