adb shell dumpsys 调出当前系统信息
程序员文章站
2024-02-29 18:31:46
...
默认打印出设备中所有service的信息, 打印出太多的信息
可以在命令后面加指定的service name.
获取servcie列表
adb shell service list
如:
0 phoneEx: [com.mediatek.common.telephony.ITelephonyEx]
1 phone: [com.android.internal.telephony.ITelephony]
2 iphonesubinfo2: [com.android.internal.telephony.IPhoneSubInfo]
3 simphonebook2: [com.android.internal.telephony.IIccPhoneBook]
4 isms2: [com.android.internal.telephony.ISms]
5 iphonesubinfo: [com.android.internal.telephony.IPhoneSubInfo]
6 simphonebook: [com.android.internal.telephony.IIccPhoneBook]
7 isms: [com.android.internal.telephony.ISms]
8 dreams: [android.service.dreams.IDreamManager]
9 commontime_management: []
10 samplingprofiler: []
11 diskstats: []
12 mtk-epo-client: [com.mediatek.common.epo.IMtkEpoClientManager]
13 mtk-agps: [com.mediatek.common.agps.IMtkAgpsManager]
14 appwidget: [com.android.internal.appwidget.IAppWidgetService]
15 backup: [android.app.backup.IBackupManager]
16 uimode: [android.app.IUiModeManager]
17 serial: [android.hardware.ISerialManager]
18 usb: [android.hardware.usb.IUsbManager]
19 audioprofile: [com.mediatek.common.audioprofile.IAudioProfileService]
20 audio: [android.media.IAudioService]
21 wallpaper: [android.app.IWallpaperManager]
22 dropbox: [com.android.internal.os.IDropBoxManagerService]
23 search_engine: [com.mediatek.common.search.ISearchEngineManagerService
24 search: [android.app.ISearchManager]
25 country_detector: [android.location.ICountryDetector]
26 location: [android.location.ILocationManager]
27 devicestoragemonitor: []
28 notification: [android.app.INotificationManager]
29 updatelock: [android.os.IUpdateLock]
30 throttle: [android.net.IThrottleManager]
31 servicediscovery: [android.net.nsd.INsdManager]
32 connectivity: [android.net.IConnectivityManager]
33 wifi: [android.net.wifi.IWifiManager]
34 wifip2p: [android.net.wifi.p2p.IWifiP2pManager]
35 netpolicy: [android.net.INetworkPolicyManager]
36 netstats: [android.net.INetworkStatsService]
37 textservices: [com.android.internal.textservice.ITextServicesManager]
38 network_management: [android.os.INetworkManagementService]
39 clipboard: [android.content.IClipboard]
40 statusbar: [com.android.internal.statusbar.IStatusBarService]
41 device_policy: [android.app.admin.IDevicePolicyManager]
42 lock_settings: [com.android.internal.widget.ILockSettings]
43 mount: [IMountService]
44 accessibility: [android.view.accessibility.IAccessibilityManager]
45 input_method: [com.android.internal.view.IInputMethodManager]
46 bluetooth_profile_manager: [android.bluetooth.IBluetoothProfileManager
47 bluetooth_socket: [android.bluetooth.IBluetoothSocket]
48 bluetooth_a2dp: [android.bluetooth.IBluetoothA2dp]
49 bluetooth: [android.bluetooth.IBluetooth]
50 input: [android.hardware.input.IInputManager]
51 window: [android.view.IWindowManager]
52 alarm: [android.app.IAlarmManager]
53 vibrator: [android.os.IVibratorService]
54 battery: []
55 hardware: [android.os.IHardwareService]
56 content: [android.content.IContentService]
57 mobile: [com.mediatek.common.mom.IMobileManagerService]
58 account: [android.accounts.IAccountManager]
59 user: [android.os.IUserManager]
60 anrmanager: [android.app.IANRManager]
61 permission: [android.os.IPermissionController]
62 cpuinfo: []
63 dbinfo: []
64 gfxinfo: []
65 meminfo: []
66 activity: [android.app.IActivityManager]
67 package: [android.content.pm.IPackageManager]
68 scheduling_policy: [android.os.ISchedulingPolicyService]
69 telephony.registry2: [com.android.internal.telephony.ITelephonyRegistr
70 telephony.registry: [com.android.internal.telephony.ITelephonyRegistry
71 display: [android.hardware.display.IDisplayManager]
72 usagestats: [com.android.internal.app.IUsageStats]
73 batteryinfo: [com.android.internal.app.IBatteryStats]
74 power: [android.os.IPowerManager]
75 entropy: []
76 sensorservice: [android.gui.SensorServer]
77 media.audio_policy: [android.media.IAudioPolicyService]
78 media.camera: [android.hardware.ICameraService]
79 drm.drmManager: [drm.IDrmManagerService]
80 memory.dumper: [android.memory.IMemoryDumper]
81 media.player: [android.media.IMediaPlayerService]
82 media.audio_flinger: [android.media.IAudioFlinger]
83 media.VTS: [android.hardware.IVTSService]
84 SurfaceFlinger: [android.ui.ISurfaceComposer]
85 GoogleOtaBinder: [GoogleOtaBinder]
86 NvRAMAgent: [NvRAMAgent]
87 DMAgent: []
adb shell dumpsys * 以上任意的服务名称
1、如显示activtiy信息:
adb shell dumpsys activity > aa.txt
'> '将信息写入文件,信息太多在控制台看不方便 如打印出的部分信息
ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Main stack:
TaskRecord{41eba088 #32 A com.hj.artbean U 0}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.hj.artbean/com.hj.artbeanformobile.home.IndexActivity }
Hist #6: ActivityRecord{4190ed78 u0 com.hj.artbean/com.hj.artbeanformobile.life.LifeDetailRichText}
Intent { cmp=com.hj.artbean/com.hj.artbeanformobile.life.LifeDetailRichText (has extras) }
ProcessRecord{41f49e40 6138:com.hj.artbean/u0a10083}
Hist #5: ActivityRecord{41ed2120 u0 com.hj.artbean/com.hj.artbeanformobile.life.LifeHomePage}
Intent { cmp=com.hj.artbean/com.hj.artbeanformobile.life.LifeHomePage }
ProcessRecord{41f49e40 6138:com.hj.artbean/u0a10083}
Hist #4: ActivityRecord{41f7e0c8 u0 com.hj.artbean/com.hj.artbeanformobile.home.MainPage}
Intent { cmp=com.hj.artbean/com.hj.artbeanformobile.home.MainPage }
ProcessRecord{41f49e40 6138:com.hj.artbean/u0a10083}
TaskRecord{41bcb898 #2 A com.android.launcher U 0}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10600000 cmp=com.android.launcher/com.android.launcher2.Launcher }
Hist #3: ActivityRecord{415d1950 u0 com.android.launcher/com.android.launcher2.Launcher}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.android.launcher/com.android.launcher2.Launcher }
ProcessRecord{415f58f0 893:com.android.launcher/u0a10037}
TaskRecord{419b9688 #33 A com.android.settings U 0}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.Settings }
Hist #2: ActivityRecord{41c68998 u0 com.android.settings/.SubSettings}
Intent { act=android.intent.action.MAIN cmp=com.android.settings/.SubSettings (has extras) }
ProcessRecord{41921610 7058:com.android.settings/1000}
Hist #1: ActivityRecord{41c0ee48 u0 com.android.settings/.SubSettings}
Intent { act=android.intent.action.MAIN cmp=com.android.settings/.SubSettings (has extras) }
ProcessRecord{41921610 7058:com.android.settings/1000}
Hist #0: ActivityRecord{41aa1d08 u0 com.android.settings/.Settings}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.Settings bnds=[96,707][192,800] }
ProcessRecord{41921610 7058:com.android.settings/1000}
对于开发调试还是有帮助的
2、显示cpuinfo
adb shell dumpsys cpuinfo >aa.txt
Load: 6.27 / 6.29 / 6.2
CPU usage from 24856ms to 125ms ago with 99% awake:
2.9% 160/adbd: 0.6% user + 2.3% kernel / faults: 2365 minor
2% 135/mediaserver: 0.5% user + 1.4% kernel
1.6% 1477/cn.chinagps.gblocation:remote: 0.9% user + 0.7% kernel / faults: 15 minor
1.2% 635/system_server: 1% user + 0.2% kernel / faults: 208 minor
0.8% 8442/logcat: 0.5% user + 0.3% kernel
0.3% 15576/kworker/0:0: 0% user + 0.3% kernel
0.2% 829/com.android.phone: 0.2% user + 0% kernel
0.2% 45/bat_thread_kthr: 0% user + 0.2% kernel
0.2% 1686/cn.chinagps.gblocation:remote2: 0% user + 0.1% kernel / faults: 2 minor
0.1% 1879/libmnlp: 0.1% user + 0% kernel / faults: 8 minor
0.1% 759/com.android.systemui: 0% user + 0% kernel / faults: 2 minor
0.1% 6138/com.hj.artbean: 0% user + 0% kernel / faults: 4 minor
0% 53/mmcqd/0: 0% user + 0% kernel
0% 115/mtk_wmtd: 0% user + 0% kernel
0% 5177/com.google.android.gms.persistent: 0% user + 0% kernel
0% 65/file-storage: 0% user + 0% kernel
0% 72/flush-179:0: 0% user + 0% kernel
0% 113/mtk_stp_psm: 0% user + 0% kernel
0% 131/surfaceflinger: 0% user + 0% kernel
0% 1007/mnld: 0% user + 0% kernel
0% 4621/com.baidu.searchbox: 0% user + 0% kernel / faults: 3 minor
0% 5676/cn.chinagps.gblocation: 0% user + 0% kernel / faults: 23 minor
0% 8185/kworker/u:3: 0% user + 0% kernel
0% 18508/cn.wps.moffice_eng:pushservice: 0% user + 0% kernel / faults: 37 minor
7.1% TOTAL: 2.8% user + 4.3% kernel + 0% iowait