G33K-TRICKS - Your source to Tips and Tricks : Set / Mock or Change Android phone Battery Level (root Required)

Sunday, February 14, 2016

Set / Mock or Change Android phone Battery Level (root Required)

Sometimes , we need to check the low battery scenario over our Android Phones under certain conditions. Either you can put the low battery into your phone for which you need to have a battery of same phone or you can reduce the battery by keeping the WIFI , GPS, BT to On, keeping the brightness level to 100% and then keeping the camera for recording a video with Flash light in On state. Doing this will easily consume your hours which nobody wants .
Here is an simple solution to , "how to change the android battery percentage"
 as per your need.

This is how you can do it!
Please note that your phone should be rooted to perform this. 
From command prompt / terminal type below set of commands.

adb root
adb shell dumpsys battery set usb 0
adb shell dumpsys battery unplug
adb shell dumpsys battery set level x 

   x indicates the percentage of battery to be set

To Reset the Battery status back

adb shell dumpsys battery reset

With Above steps will help in mocking the Low Battery scenario, in-case you want to test an android app behaviour with low batt.
To get the battery stats back, just reboot the phone.

No comments:

Check Out the Latest Posts

Recent Posts Widget