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


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:


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):

  1. Go to Settings > About Phone
  2. Tap Build Number 7 times to enable Developer Options
  3. Go to Settings > Additional Settings > Developer Options
  4. Enable USB Debugging

4. πŸ”Œ Connect Phone to Mac


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

© Rajesh Kumar, SKMU Β· Physics Lecture Notes Β· rajeshphy.github.io

Discussion

Share This Page