Android Debug Bridge
The Ultimate Developer Tool
What is ADB and What Is It Used For?
The Android Debug Bridge (ADB) is a command-line tool that’s part of the Android SDK, enabling communication between a computer (Windows, macOS, or Linux) and Android devices (phones, tablets, or emulators). ADB facilitates debugging, maintenance, app installation, and remote control, making it essential for developers and advanced users.
1. ADB Architecture
ADB consists of three main components:
- Client: the command-line interface (
adb) you run on your computer. - Daemon (adbd): a process running on the Android device, receiving commands from the client.
- Server: a process on your machine that manages the connection between the client and the device daemon.
When you run adb , the client sends the request to the server (which starts automatically
if not already running), and the server forwards it to the device’s daemon over USB or Wi-Fi.
2. Installation and Setup
-
Download Android SDK Platform Tools
Go to the official Android site and download the package for your OS. -
Unzip and Add to PATH
Extract the folder and add its path to your system’sPATHso you can calladbfrom any terminal. -
Enable USB Debugging on the Device
On Android: Settings → About phone → tap “Build number” seven times to activate Developer options.
Then Settings → Developer options → enable “USB debugging.”
adb devices
3. Basic Commands
| Command | Description |
|---|---|
adb devices | Lists connected devices |
adb push | Copies a file from PC to device |
adb pull | Copies a file from device to PC |
adb install | Installs an APK on the device |
adb uninstall | Uninstalls the app by package name |
adb shell | Opens a remote shell on the device |
adb logcat | Shows system and app logs in real time |
adb reboot | Reboots the device |
adb tcpip | Switches to Wi-Fi mode |
adb connect | Connects over TCP/IP to the device |
4. Common Uses
4.1 App Debugging
Use adb logcat to capture Android log messages in real time.
adb shell screencap /sdcard/screen.png
adb pull /sdcard/screen.png .
adb shell screenrecord /sdcard/video.mp4
adb pull /sdcard/video.mp4 .
4.2 Bulk Install/Uninstall
for apk in ./builds/*.apk; do adb install -r "$apk"; done
4.3 Shell Access & Admin
adb shell chmod 755 /data/local/tmp/my_script.sh
4.4 Wireless Connection
adb tcpip 5555
adb connect 192.168.1.10:5555
5. Best Practices
- Shut down server when done:
adb kill-server - Use minimal permissions; be cautious with
root. - Document scripts and handle errors (e.g.,
adb wait-for-device). - Disable USB debugging on daily-driver devices for security.
6. Conclusion
ADB is a powerful tool for developers, testers, and power users. Master it to unlock full control over your Android devices.