01 Nov 2026
Introduction to ADB (Android Debug Bridge)
Learn how to use ADB to connect your Android device to your Mac and perform various operations.
ADB
Android
Terminal
Developer Tools
π― Learning Objectives
- Understand what ADB is and why it is useful.
- Install and configure ADB on macOS.
- Connect an Android phone using ADB.
- Perform basic ADB operations such as listing files, transferring files, and accessing device shell.
1. π What is ADB?
ADB (Android Debug Bridge) is a command-line tool that allows communication between your computer and an Android device. It is used by developers and advanced users to:
- Debug apps
- Transfer files
- Access internal system logs
- Run shell commands on the Android device
2. βοΈ Installation on macOS
Step 1: Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step 2: Install ADB using Homebrew
brew install android-platform-tools
3. π² Enable USB Debugging on Android
On Your Phone (e.g., Oppo F7):
- Go to Settings > About Phone
- Tap Build Number 7 times to enable Developer Options
- Go to Settings > Additional Settings > Developer Options
- Enable USB Debugging
4. π Connect Phone to Mac
- Use a USB data cable
- Set USB mode to File Transfer (MTP)
- Accept βAllow USB debuggingβ prompt on your phone
5. π» Verify ADB Connection
Command:
adb devices
Expected output:
List of devices attached
ABC1234567 device
If it says unauthorized, check your phone for the prompt and tap Allow.
6. π§ͺ Common ADB Commands
π List files on phone storage:
adb shell ls /sdcard/
π₯οΈ Start a shell session inside the phone:
adb shell
π€ Copy file from phone to Mac:
adb pull /sdcard/DCIM/Camera/IMG_20230605_103214.jpg ~/Pictures/
π₯ Copy file from Mac to phone:
adb push myfile.pdf /sdcard/Download/
π§Ή Delete a file from phone:
adb shell rm /sdcard/Download/myfile.pdf
7. πΈ Access Camera Folder
View contents:
adb shell ls /sdcard/DCIM/Camera
Copy all camera images:
adb pull /sdcard/DCIM/Camera ~/Pictures/OppoCamera
8. π§° Optional: Automate with a Script
You can create a simple sync script to pull new photos from your phone automatically. Ask the instructor for details.
π Summary
| Task | Command |
|---|---|
| Install ADB | brew install android-platform-tools |
| Connect device | adb devices |
| Enter phone shell | adb shell |
| List phone files | adb shell ls /sdcard/ |
| Pull file from phone | adb pull <source> <destination> |
| Push file to phone | adb push <source> <destination> |
| Delete file | adb shell rm <path> |
π References
- Official Android ADB Docs
man adb(if installed via Homebrew)
Discussion