help-icon
icon

ADB Installation and Usage Guide

helpDetails-time-icon2026-04-10T12:00:00+08:00

ADB Installation and Usage Guide

This document explains how to install, configure, and use ADB (Android Debug Bridge) on Windows, macOS, and Linux for both physical devices and cloud phones.

What Is ADB

ADB is the official Android debugging bridge tool. It supports device connection, app installation, log viewing, file transfer, and port forwarding.

Core components:

  1. Client: The adb command you run in your terminal.

  2. Server: A local background process, usually listening on port 5037.

  3. Daemon (adbd): A daemon process running on Android devices.

Prerequisites

  1. Ensure your terminal can access the internet to download Android SDK Platform-Tools.

  2. Use official platform-tools whenever possible.

  3. For physical phones, enable Developer Options and USB debugging.

Windows Installation

  1. Download and unzip Android SDK Platform-Tools (recommended path: C:\platform-tools).

  2. Set environment variables:

    Add C:\platform-tools to system Path.

  3. Open PowerShell / CMD and run:

    adb version

    If version output appears, installation is successful.

  4. When connecting a phone by USB for the first time, allow the USB debugging prompt on the device.

macOS Installation

  1. Method 1 (recommended): install platform-tools via Homebrew:

    brew install android-platform-tools

  2. Method 2: download the official archive, extract it, and add the directory to PATH.

  3. Verify installation:

    adb version

  4. If you see permission/path issues, reopen terminal or check ~/.zshrc / ~/.bashrc.

Linux Installation

  1. Ubuntu / Debian:

    sudo apt update && sudo apt install -y android-sdk-platform-tools

  2. CentOS / RHEL (may require EPEL or manual package):

    Recommended: install official platform-tools manually.

  3. Verify installation:

    adb version

  4. If USB permission fails, add udev rules and reload.

First Connection and Verification

  1. Start ADB server:

    adb start-server

  2. List devices:

    adb devices

  3. Status meanings:

    device: ready; unauthorized: not authorized; offline: connection problem.

Wireless and Remote Connections

LAN connection example:

  1. adb connect 192.168.1.10:5555

  2. Run adb devices and confirm status is device.

Cloud phone via SSH tunnel:

  1. Create tunnel:

    ssh user@host -p 1824 -L 8767:adb-proxy:53398 -Nf

  2. Connect locally:

    adb connect localhost:8767

  3. Note: local port is the left side of -L (here 8767).

Common Commands

  1. List devices: adb devices -l

  2. Open shell: adb shell

  3. Install APK: adb install app.apk

  4. Reinstall APK: adb install -r app.apk

  5. Uninstall app: adb uninstall package.name

  6. View logs: adb logcat

  7. Push file: adb push localfile /sdcard/

  8. Pull file: adb pull /sdcard/file localdir

  9. Port forward: adb forward tcp:7001 tcp:7001

  10. Disconnect: adb disconnect

Multiple Devices

When multiple devices are online, use -s with serial number:

adb -s SERIAL shell

adb -s SERIAL install -r app.apk

Troubleshooting

  1. adb: command not found

    Check installation and Path, then reopen terminal.

  2. unauthorized

    Allow USB debugging on device; run adb kill-server && adb start-server if needed.

  3. offline

    Run adb disconnect, reconnect, and check network/port reachability.

  4. Port already in use

    Change local port (for example -L 8768:...) and use adb connect localhost:8768.

  5. ADB server abnormal

    Restart with adb kill-server and adb start-server, then check adb devices.

Best Practices

  1. Pin ADB version for automation environments.

  2. Always use -s in multi-device scripts.

  3. For cloud phones, prefer SSH tunnel instead of exposing debug ports directly.

  4. Close tunnels and idle sessions when no longer needed.

Note: Use ADB only on devices you are authorized to manage.

Chat supportEmail contactBack to top
Cookie notification iconCookie Notice
This website uses cookies to improve the user experience. To learn more about our cookie policy or withdraw from it, please check our Privacy Policy and Cookie Policy.