Android

ADB Debugging on Android: Step-by-Step Setup and Usage

In this guide, you'll learn how to set up Android Debug Bridge (ADB) for debugging Android devices. You'll be able to install apps, retrieve logs, and control the device via the command line.

Updated at February 16, 2026
10-15 min
Medium
FixPedia Team
Применимо к:Android 10Android 11Android 12Android 13

Introduction

Android Debug Bridge (ADB) is a powerful command-line tool that allows you to interact with an Android device from your computer's operating system. With ADB, you can install and remove apps, retrieve system logs, execute shell commands on the device, copy files, and much more. This guide will help you quickly set up ADB and start debugging, whether you're a developer or just an enthusiast looking to customize your device.

Requirements

Before you begin, make sure you have:

  • A computer running Windows, Linux, or macOS.
  • A USB cable that supports data transfer (not just charging).
  • An Android device (version 5.0 or higher).
  • Internet access to download the tools.

Step 1: Install Android SDK Platform-Tools

ADB is included in the Platform-Tools package from the Android SDK. Download it from the official website:

  1. Go to the SDK Platform-Tools page.
  2. Select the version for your operating system (Windows, Linux, macOS).
  3. Extract the archive to a convenient folder, for example, C:\platform-tools (Windows) or ~/platform-tools (Linux/macOS).
  4. Add the path to this folder to the system PATH variable:
    • Windows:
      Open "System" → "Advanced system settings" → "Environment Variables". Under "System variables", find Path, and add the path C:\platform-tools.
    • Linux/macOS:
      Add the line export PATH=$PATH:~/platform-tools to the ~/.bashrc or ~/.zshrc file, then run source ~/.bashrc (or source ~/.zshrc).
  5. Verify the installation by opening a new terminal/command prompt and running:
    adb version
    
    You should see the ADB version number.

⚠️ Important for Windows: You may need USB drivers for your device. These can be found on the manufacturer's website or by using the Google USB Driver (via Android SDK Manager). If the device is not detected, install the drivers manually through Device Manager.

Step 2: Enable USB Debugging on Your Android Device

By default, the USB debugging option is hidden. To activate it:

  1. Open SettingsAbout phone (or About device).
  2. Find the Build number entry and tap it 7 times. You will see the message "You are now a developer!".
  3. Go back to the main settings menu. The Developer options entry is now available.
  4. In Developer options, find and enable USB debugging.
  5. (Optional) Enable Revoke USB debugging authorizations and then disable/re-enable USB debugging to clear old authorizations.

Step 3: Connect the Device and Authorize

  1. Connect the device to your computer using the USB cable.
  2. A dialog will appear on the device asking Allow USB debugging?. Check Always allow from this computer and tap OK.
  3. If the prompt does not appear, try switching the USB connection mode to File Transfer (MTP) or PTP (in the USB connection notification).

Step 4: Verify the Connection

Open a terminal or command prompt and run:

adb devices

The output will look something like:

List of devices attached
XXXXXXXXXXXX    device

If your device appears with the status device, the connection is successful.

Possible statuses:

  • unauthorized — you have not confirmed authorization on the device. Check the dialog on your phone.
  • offline — the device is not responding. Try reconnecting the cable or rebooting the device.
  • Nothing is displayed — the device is not detected. Check the cable, drivers (Windows), and that debugging is enabled.

Step 5: Basic ADB Commands

Now you can run useful commands. Here are a few examples:

  • Launch device shell:
    adb shell
    

    After entering, you will be in the device's command line (like Terminal on Android). To exit, press Ctrl+D or type exit.
  • Install an APK file:
    adb install path/to/file.apk
    

    Add the -r flag to reinstall while preserving data: adb install -r app.apk.
  • Copy a file from the device to the computer:
    adb pull /sdcard/file.txt ./
    
  • Copy a file from the computer to the device:
    adb push file.txt /sdcard/
    
  • View logs (logcat):
    adb logcat
    

    To filter logs for your app, use adb logcat | grep "YourApp".
  • Reboot the device:
    adb reboot
    
  • Get device information:
    adb shell getprop ro.product.model   # model
    adb shell getprop ro.build.version.release   # Android version
    

Verification

After completing the steps, you should be able to connect to the device and run commands successfully. Check that adb devices shows your device and that basic operations (like adb shell or adb install) work without errors. If everything works—you're ready to debug!

Possible Issues

Device not showing in adb devices

  • USB debugging is disabled. Go back to Step 2 and ensure the option is enabled.
  • No authorization. You must confirm on the device. If you tapped "Deny", open developer options and revoke USB debugging authorizations, then reconnect.
  • Cable issues. Use an original cable that supports data transfer. Try a different USB port.
  • Drivers on Windows. Install drivers for your device. Google devices work with Google USB Driver; others use manufacturer drivers.
  • Conflict with other software. Programs like Samsung Kies, HTC Sync, or Mi PC Suite may intercept the connection. Close them.

"error: device offline"

  • Reboot the device and computer.
  • Toggle USB debugging off and on on the device.
  • On Windows: try installing drivers manually via Device Manager (select "Android ADB Interface").

"error: no devices/emulators"

  • Ensure adb is run as administrator (on Windows) or with sudo (on Linux/macOS) if USB device access requires elevated privileges.
  • Check that no other ADB instances are running (e.g., from Android Studio). End them via Task Manager.

ADB works but commands in adb shell fail

  • Some commands require root access. Obtain root (if the device is rooted) or look for ADB alternatives that don't require root.
  • To access protected system files, use adb remount (requires root) or adb shell su -c "command".

Slow file transfer

  • Use adb pull/adb push instead of adb shell cp for large files.
  • Check USB port speed (USB 2.0 vs 3.0) and cable quality.

If the issue persists, search for the specific error in our knowledge base or on Android developer forums.

F.A.Q.

What is ADB and why do I need it?
How do I enable USB debugging on Android?
Why doesn't ADB see my device?
Can I use ADB without root access?

Hints

Install Android SDK Platform-Tools
Enable USB debugging on the device
Connect the device to the computer
Check the connection with adb devices
Run a test command
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community