1

Measure battery drain using ADB commands for a specific package name.

Battery stats for the package name since the last charge to the android device. To measure performance of the device or to automate the non-functional testing for your application in the android devices

Siva
  • 1,078
  • 4
  • 18
  • 36

1 Answers1

2

We can measure the battery drain using the following command

adb shell dumpsys batterystats --charged <packageName>

For more information on the batterystats refer this link: https://source.android.com/devices/tech/power/batterystats

Siva
  • 1,078
  • 4
  • 18
  • 36
  • According to [Batterystats Walkthrough](https://developer.android.com/studio/profile/battery-historian-charts.html), the estimated power use (mAh) by UID and peripheral is currently an "_extremely rough estimate and should not be considered experiment data_". So beware if you need precise measurement. – foo Oct 12 '17 at 08:13
  • Is it possible to increase the sensitivity of the android Batterystats? Currently, it provides information 2 digits after the decimal point. I want to increase 3 or 4 digits after the decimal point. – user1850484 Feb 02 '18 at 15:31
  • @foo It seems this information was removed from the page, is it usable for experimentation now? – Stefan May 12 '20 at 14:15
  • @Stefan sorry I'm not sure as I'm not really keeping up on this. – foo May 12 '20 at 14:46