DEV Community

Giorgos Neokleous
Giorgos Neokleous

Posted on • Edited on

10 1

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

Sentry mobile image

Mobile Vitals: A first step to Faster Apps

Slow startup times, UI hangs, and frozen frames frustrate users—but they’re also fixable. Mobile Vitals help you measure and understand these performance issues so you can optimize your app’s speed and responsiveness. Learn how to use them to reduce friction and improve user experience.

Read the guide →

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay