Battery Testing

I want to check how my application affects the battery of a phone / tablet.

Are there any testing tools that will allow me to do this?

For example, I want to check which modules of my application consume the most battery, etc.

+58
android testing
Sep 27 '11 at 9:27 a.m.
source share
6 answers

In practice, I find that most applications that have power problems also have processor problems. That is, the usage profile of your application is probably a good approximation to the consumption of your battery. There are caveats and exceptions if, for example, your application does something expensive with a GPU, wireless network, storage, etc., and that an expensive operation does not require a lot of processor time.

Here's an interesting blog about the Power Tutor app that provides a more accurate measurement on a running system than the built-in battery app: http://gigaom.com/mobile/android-power-consumption-app/ . I have not tried.

For a different level of detail, here is a document that breaks down which components of the phone suck the greatest juice (note that the paper is from 2010): http://www.usenix.org/event/usenix10/tech/full_papers/Carroll.pdf ( Just go to section 5 to read their results). They say screen brightness is the biggest culprit.

If the brightness of the screen is the biggest culprit, be sure to set it to a fixed level if you measure your own use of the application.

If you are really interested in measuring energy consumption, you can follow their methodology (which causes the phone to open and physically connect the measurement devices.)

+20
Sep 28 '11 at 19:02
source share

A new tool has come that comes with Android 5.0.

You can run

adb shell dumpsys batterystats > dump.txt 

To get the full backup battery of your device. You can also add some parameters, such as --unplugged (only output from the last disconnect) or --charged (only output from the last charge). You can also add a package name to receive information only for this package / application:

 adb shell dumpsys batterystats --unplugged your.package.name > dump.txt 

The > dump.txt puts everything in a file (maybe it just works on Windows, but not sure. But you can just leave it, the dump will be printed right on the console, where you can copy it and put it in a file).

This only works if you have a device with Android 5.x. If you have a device with a lower level, you can try to use

 adb shell bugreport > bugreport.txt 

But this file will be very large. (~ 8MB +)

After creating this file, you can use the Historian Tool for Google

To use it, you must install Python 2.7.9 and run the following command

 python /path/to/historian.py dump.txt > battery.html 

This will create a battery.html file where you can see the data in a more convenient format.

Last thing: If you want to reset, battery dump statistics just calls

 adb shell dumpsys batterystats --reset 

(just works with Android 5.x)

+26
Jan 07 '15 at 14:15
source share

The question you asked is a research topic right now. There are several studies to track the use of fine-grained energy consumption, i.e. Track power usage by stream or subroutine. \

eprof is one tool developed by some university graduations.

You can find several articles on this topic: http://web.ics.purdue.edu/~pathaka/pubs.html

I am working on the same thing, I will definitely inform you if anything is suitable for ordinary users.

+4
Jun 26 2018-12-12T00:
source share

As for Android 2.3.3, the system has its own battery monitor.

Settings β†’ About phone β†’ Battery usage

+1
Sep 27 '11 at 20:05
source share

I would say that there is no real tool for testing it, since it cannot be precisely defined. If you take an iPhone, you will see that the number of batteries will go from 40% to 30%, and then stay there for a while, drop to 20%, decrease to 15%, go up to 25%, return to 20% ECT, which you can do is charge the phone for a long period of time to make sure it is fully charged, and then use your application until the phone closes, and remember the amount of time it took. Now do it with a different version and see the result. Basically, you will have to play the MasterMind game if you want to do as few tests as possible. Also, if the change is not so simple, it is probably not very important.

-one
Sep 27 '11 at 10:18
source share

We did a similar test to find out how my app is responsible for the battery consumption of the Nexus5.

But, unfortunately, we could not get help from any tool, but basically it was based on manual testing.

We identified some modules in the application that were suspected of increasing battery consumption.

  • Location information module using GPS.

  • A boot module that uses a network connection starts the background for a long time.

  • A video creation module that also loads the CPU due to background operation. and so on...

Finally, after 3-4 rounds of testing, we had a certain trend in the data, and we were able to identify the module, which was the big culprit in battery consumption.

Basically there will be more battery consumption if something keeps the processor longer. Therefore, we can think of a module that has background operations associated with network operations.

At the moment, I can’t find a tool that could say above the test result in a specific application.

I hope my experience will be useful for declaring requirements in the original question.

-one
Apr 09 '15 at 19:28
source share



All Articles