在shell下面执行命令: adb shell dumpsys batterystats
1. 手机开机时间 搜索关键字RESET:TIME
Battery History (101% used, 258KB used of 256KB, 103 strings using 10KB):
0 (26) RESET:TIME: 2010-01-01-08-56-31
Reset time: 表示手机开机时间是2010年1月1日上午8点56分
2. 电量百分比
+14s977ms (2) 062 -top=1000:"android" +14s977ms (2) 062 +top=u0a25:"com.tct.launcher" +16s034ms (2) 062 +audio +17s179ms (2) 062 phone_state=off 每行第一列是时间,而且是相对时间。相对于1.1里提到的手机开机时间 第二列不太清楚,作用不大,可以忽略 第三列是电量百分比 062代表62%
3. 充电和不充电状态 搜索关键字status=
+5h17m21s015ms (3) 051 status=charging plug=usb volt=3802 +plugged brightness=medium
+5h17m21s015ms 这是相对时间,绝对时间是2010-01-01-08-56-31+5h17m21s015m = 下午两点13分 051 代表电量51% status=charging 代表 下午两点13分这个时间点正在充电, plug=usb 是usb充电
4. 亮屏和灭屏状态 搜索关键字 brightness=
+1m02s904ms (2) 062 brightness=dark +1m02s904ms 代表时间 2010-01-01-08-56-31+1m02s904ms = 2010-01-01-08-57m-33s 062 代表电量62% brightness=dark 代表屏幕灭屏 +5h17m07s783ms (4) 051 +running +wake_lock=1000:"PhoneWindowManager.mPowerKeyWakeLock" +screen brightness=medium wake_reason=0:"unknown" screenwake=1000:"android.policy:POWER" 051 代表电量51% brightness= medium 代表亮屏,屏幕亮度是medium状态 只要brightness不是dark状态都代表屏幕亮着
5. 手机是否休眠状态 搜索关键字-running和+running · +2m45s859ms (1) 061 -running
061 代表电量61% -running 代表cpu进入休眠 +2m52s798ms (2) 061 +running wake_reason=0:"unknown"
061 代表电量61% +running 代表cpu退出休眠,正在运行
6. 手机是否进入Doze状态 搜索关键字device_idle=
0m34s785ms (2) 059 +running +wake_lock=1000:"*walarm*:DeviceIdleController.light" device_idle=off wake_reason=0:"Abort:Some devices failed to suspend, or early wake event detected"
device_idle=off 退出doze状态 +1h20m42s766ms (2) 059 +running device_idle=light wake_reason=0:"unknown" device_idle=light 进入light doze状态
+1h20m42s766ms (2) 059 +running device_idle= full wake_reason=0:"unknown" device_idle=full 进入deep doze状态
7. Wifi是否在打开 搜索关键字+wifi_running和- wifi_running
+40m09s967ms (1) 098 +wifi_running +wifi +40m10s152ms (1) 098 +wifi_scan -wifi_running -wifi +wifi_running wifi打开 -wifi_running wifi关闭
8. 是否打电话 搜索关键字+phone_in_call和-phone_in_call
+1h33m41s601ms (2) 091 +phone_in_call active=u0a95:"com.huawei.vdrive" +1h34m16s780ms (3) 091 data_conn=hspap -phone_in_call +phone_in_call 开始打电话 -phone_in_call 挂断电话
9. 相机是否打开 搜索关键字 +camera和-camera
+1h42m13s770ms (2) 088 +running +wake_lock=1000:"HwPhoneWindowManager. mVolumeDownWakeLock " +mobile_radio +camera wake_reason=0:"unknown" +1h42m14s776ms (2) 088 -camera +top=u0a68:"com.huawei.vassistant" +camera 相机打开 -camera相机关闭