DEV Community

Giorgos Neokleous
Giorgos Neokleous

Posted on • Updated on

Android ADB Commands (Part 1) Battery

ADB Commands

According to documentation:

Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.

Link for more info.

I will try through a series of posts to go through my favorite commands.

1) Set battery level

adb shell dumpsys battery set level 5

The command above, sets the phone's battery to 5%. This could be used to test how the app behaves with low battery level, or if your dark theme is being enabled etc.

Reset the battery level back to the real one with

adb shell dumpsys battery reset

Part two available now

Top comments (0)