Android - Drain battery quickly on purpose

43,656

Solution 1

For fastest drain turn on at once all battery drainers:

  • Acquire a Wake lock with Full screen brightness (No. 1 battery drainer)
  • Vibration
  • GPS with zero time polling intervals
  • Turn on WiFi and continuously issue http requests
  • Turn on Bluetooth and continuously issue scan commands

And, since you're a smart guy, you will probably use this app instead of hand-coding all of the above.

Solution 2

There is an AVD target that contains Play Services (Google APIs target). avd

Edit: you should also be able to use Genymotion from what I've read. It's also much faster than the stock emulator, but if your app uses any native code it may not work.

Share:
43,656
arleitiss
Author by

arleitiss

Updated on July 09, 2022

Comments

  • arleitiss
    arleitiss almost 2 years

    I am nearly finished with my app and last functionality to be made is to call specific action when battery level reaches below specific level.

    So for test purposes I am wondering - how can I drain battery?

    P.S - Using AVD wont work since my app is using Google Play services so I am testing app on my phone.

  • arleitiss
    arleitiss almost 10 years
    Yeah I make app in Native.
  • arleitiss
    arleitiss almost 10 years
    I just ended up: Instead of getting required minimal value for battery like: if(current_level <= UserSetting) I just took my current level of battery and made it less than two, turned brightness to max and music playing + awaked lockscreen + flashlight. Chosing correct answer for linked app, I tried searching for such but all I found was battery saved.
  • inf3rno
    inf3rno over 8 years
    Checked some reviews of your suggested app: "Youtube drains better than you..." I think I'll use youtube with full brightness instead... Navigation is another option, it use to drain my phone in 3 hours. Still very slow, since I want to test a power bank, which can fully charge the phone at least 5 times.