I want to test mobile app battery consumption on android. I am new to this. Is there anyone who can guide me about this?
-
What does the app do? What modes does it have? Are there things you would logically expect to consume more battery than others? Without the answer to these questions, there isn't much of a plan that can be made.– corsiKa ♦Commented Dec 18, 2015 at 20:10
-
Very similar. Check out the link Here.– User_007Commented Dec 19, 2015 at 12:01
3 Answers
You can use adb
to get battery consumption of your app by
adb shell dumpsys batterystats [your.package.name]
The result is very detail, so you may need to use grep
to fine grain information you want and then import result into your continuous integration.
If you only need to know an over view of battery usage for all your tests in a controlled environment, adb shell dumpsys battery
should be enough. You can grep the battery level by adb shell dumpsys battery | grep level
You can have further information from The Android official site
Go to Settings > About phone > Battery Usage
- The top battery drainers:
Mobile apps are going to use battery, but some take it to the next level, and there is a common thread between those specific apps.
- Power-saver modes:
Check power saving mode in your mobile friends or foe..?
- Low battery Performance: Mobile app development and testing teams must also be aware of how an app performs on devices that do not throttle battery use when the tank is running on empty.