Android debugging -> battery drains

4.9k Views Asked by At

Have you noticed a significant battery drain when debugging Android application on the phone?

Also, does a lot of Log.d() messages drains the battery?

3

There are 3 best solutions below

1
On BEST ANSWER

Not really.

Is not your phone connected to your PC, and thus charging, while you perform debugging?

Every operation on Android drains battery, but I do not think Logging drain battery more than, say, drawing screen updates.

0
On

If your definition of "debugging Android application on the phone" is: you test your application while your phone is connected to your PC, then no. Your phone will charge all the time and the battery will get charged faster than it will drain, so you shouldn't have any worries.

On the other hand, if your phone isn't connected to PC, and you are calling Log.d() a LOT, let's say, 1,000,000 times in a loop, then yes, this will put a strain on your battery, since you will generate a lot of string statements that will appear under Logcat's logs and old logs will have to be discarded. Don't overdo it with logging messages.

0
On

Yes! I just started debugging my Android apps on my phone (Motorola Droid) rather than on the emulator a few days ago because it's so much faster. Since then my battery life has become abysmal. Of course it doesn't get drained while I'm actually debugging because at that time the phone is connected to my PC and is charging from it. But the rest of the day my battery seems to drain much faster than it used to. When I look at the Battery Use screen in Settings it indicates that "Android OS" is using a significant amount of battery, far more than it ever did in the past. I have no idea what is causing this or how to fix it.