Can anyone tell me how can I simulate low battery in my rooted device?
I gone through this question but did not find much information on this.
With the Android Emulator's Extended Controls, it's now possible to set the battery level with a GUI slider called "Charge Level."
To access this, start the emulator. Then click the "..." at the bottom of the settings panel (which hovers to the right of the emulator).
This opens the Extended Controls panel which contains a "Battery" menu item:
The Charge Level slider goes from 0 to 100%. You can also simulate failed/overheated/etc physical battery, and being off the charger by adjusting the other drop down controls.
Use the following commands
To simulate the device being unplugged:
adb shell dumpsys battery unplug
To test how the device behaves under low power conditions:
adb shell settings put global low_power 1
Once you have finished your testing, you can undo your manual device settings with this command:
adb shell dumpsys battery reset
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With