If you've spent any time exploring the world of Android customization or power-user features, you've almost certainly heard of ADB. But what is it, and how do you use it?
ADB stands for Android Debug Bridge. It's a versatile, official command-line tool from Google that lets your computer communicate directly with your Android device. Developers use it to debug apps, but power users can use it to perform advanced tasks that aren't normally possible through the phone's interface.
How to Enable ADB
Before you can use ADB, you must enable "Developer Options" and "Debugging" on your device.
- 1. Unlock Developer Options: Go to Settings → About Phone. Tap on "Build Number" seven times until you see a message that says "You are now a developer!"
- 2. Enable Debugging: Go to Settings → System → Developer Options. Find and enable "USB Debugging" (for a wired connection) and/or "Wireless Debugging" (for a cable-free connection).
How to Run ADB Commands
You have two main options for running ADB commands:
Method 1: Using a Computer (PC/Mac/Linux)
This is the traditional method. It's reliable and gives you full access.
- 1. Download Platform-Tools: Download the official "SDK Platform-Tools" for your operating system from Google's developer site: Android SDK Platform-Tools.
- 2. Unzip & Open Terminal: Unzip the file. On Windows, you can hold Shift + Right-click inside the folder and select "Open PowerShell window here". On Mac/Linux, open a terminal and `cd` into the folder.
- 3. Connect Your Device: Plug your phone into your computer via USB. On your phone's screen, you'll see a prompt asking to "Allow USB debugging". Check "Always allow" and tap "Allow".
- 4. Run Commands: In your terminal/PowerShell, type `./adb devices` (or `adb devices` on Windows) and press Enter. You should see your device's serial number. You're now ready!
Method 2: Using an On-Device App (No PC)
Thanks to the "Wireless Debugging" feature (Android 11+), you can now run ADB commands on your phone itself. This is perfect for setting things up on the go.
- 1. Enable Wireless Debugging: Follow the steps in the first section to enable "Wireless Debugging" in Developer Options.
- 2. Use an App like LADB: Install an app that can act as a local ADB shell. A popular open-source option is LADB, which you can find on GitHub.
- 3. Pair the App: When you first open LADB, it will ask for a port and pairing code. In your "Wireless Debugging" settings, tap "Pair device with pairing code" to get this info. Enter it into LADB, and you'll have a command-line shell right on your phone.
What Can You Do with ADB?
ADB opens up a world of possibilities. You can install/uninstall apps, manage files, and change deep system settings. One of the most powerful things you can do is set a Device Owner app.
A Device Owner gives an app full administrative control over your phone, allowing it to enforce security policies, block features, and more. This is how our DroidMDM tool works.
To learn more about what this means and why it's so powerful, read our full guide: What is a Device Owner App?