Reputation: 147
How to measure app power consumption when I connect my device with my pc?
I've read about batterystats from Android Studio. And I've followed the instructions and get a batterystats dumpsys. However, I can't not let my device consistently plugged on usb port because the result of dumpsys will have a missing part called "Estimated power use". Which is the most important part of the whole test because the app power consumption it contained.
I've tried using StopCharge app to interrupt phone charging. But the prerequisite is that the device need to get ROOT.
Other options like power tutor is outdated. Information out from the application can't quite fit my request(Android 6.0 or upper).
Is it possible to get the power consumption measurement of an application when it's charging or is my mind out of the roof?
Thank you in advance!
p.s the following is a sample of the method of Android Studio batterystats
Estimated power use (mAh)
Capacity: 2930, Computed drain: 43.9, actual drain: 58.6-87.9
Screen: 35.6
Unaccounted: 14.7 ( )
Uid u0a2618: 2.91 ( cpu=2.17 wake=0.657 wifi=0.00656 sensor=0.0732 )
Upvotes: 1
Views: 2486
Reputation: 735
I think when you plug, the battery stats are not very accurate. There's two ways i usually do:
Connect the adb by wi-fi and run batterystats
Or if you don't wanna a new plugin
adb tcpip 5555
and adb connect 192.168.0.101:5555
if you already have usb access (More info.)-
Use the Google Battery Historian:
adb shell dumpsys batterystats --reset
to clear all the historyadb bugreport > bugreport.txt
Image of the Battery Historian:
Upvotes: 3