Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

ADB (Android Debug Bridge) lets you connect a computer to an Android device or emulator, open its shell, install apps, transfer files, capture screenshots, and inspect logs. Start by checking the connected-device list, select the intended target explicitly when needed, and then run device-side utilities through adb shell. This guide covers the essential commands, what they change, and how to troubleshoot common connection and shell issues.

What ADB does—and where its commands run

Android describes ADB as “a versatile command-line tool that lets you communicate with a device.” It is included in Android SDK Platform Tools. The setup has a client on your workstation, a server on the workstation, and a daemon running on the device; together they let the computer communicate with Android and expose a device shell. See the Android Debug Bridge documentation and Platform Tools release information.

Commands beginning with adb run from the workstation. Commands such as pm, am, screencap, getprop, df, and ls run on the device, either after entering its shell or by passing them to adb shell. For example, adb install app.apk is an ADB command; adb shell pm list packages invokes the device’s package manager.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install Platform Tools and connect a device

Install or update Platform Tools through Android Studio’s SDK Manager or with sdkmanager; Android also offers a standalone download. Android says Platform Tools updates are backward compatible with earlier platform versions. Make sure the tools are available in your workstation’s PATH, or run commands from their installation directory.

USB debugging

  1. On the Android device, enable Developer options, then turn on USB debugging. The exact menu names vary by manufacturer and Android build; use the device’s settings search if necessary.
  2. Connect the device to the computer using a cable that supports data transfer. Check that the cable and both ports fit your devices; a charge-only cable will not provide an ADB data connection.
  3. On the workstation, run adb devices.
  4. If Android displays an RSA debugging prompt, review it and approve the computer only if you trust it. Android requires this approval on Android 4.2.2 (API 17) and later.

Wireless debugging

Android’s wireless debugging workflow for phones is available from Android 11 (API 30), with pairing and same-network requirements described in the official connection guide. Menu locations and support can vary by device. Android’s guide states Android 13 (API 33) as the minimum for TV and Wear OS. Use the pairing flow shown in Developer options rather than assuming every device uses identical screens or steps.

Connection Minimum stated by Android guide What you need Best fit
USB No single minimum is stated for USB debugging in the cited setup guidance. USB debugging enabled, data-capable cable, computer authorization when prompted. Direct setup, or when wireless pairing is unavailable.
Wireless, phone Android 11 (API 30). Wireless debugging, pairing, and devices on the same network. Repeated testing without keeping a cable attached.
Wireless, TV or Wear OS Android 13 (API 33), according to Android’s guide. Supported wireless debugging and pairing on the same network. Supported TV or Wear OS development workflows.

Check the connection and select the right target

List attached devices and emulators:

adb devices

A device marked device is available for commands. A status such as unauthorized means the device has not approved the computer’s debugging key; unlock it and accept the prompt. If more than one target is connected, copy the serial shown by the command and select it explicitly. Never assume ADB will choose the device you intend.

adb -s SERIAL shell

Replace SERIAL with the actual serial, without the placeholder word. For a single attached physical device, -d selects the USB device; -e selects an emulator. Use -s SERIAL when you need to name a specific target. The same selection can prefix other workstation commands, for example adb -s SERIAL pull .... The command-line reference is at Android’s ADB command summary.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Open a shell and inspect the device

Open an interactive shell on the selected device:

adb -s SERIAL shell

At the device prompt, run commands such as these. The listed utilities are common, but availability, permissions, and output can vary by Android build. Android recommends checking device help and /system/bin to discover the tools present on a particular system.

getprop
df -h
ls /sdcard

To run a single command without entering an interactive shell, prefix it with adb shell:

adb shell getprop
adb shell df -h
adb shell ls /sdcard

getprop prints system properties, df -h reports filesystem usage in a human-readable format where supported, and ls lists directory contents. Output is device-specific; these commands do not guarantee that every path is readable or that every build includes identical options.

List packages and manage app processes

List installed packages

adb shell pm list packages

This lists package identifiers known to the package manager. Treat a package name as an identifier, not necessarily as the app’s display name. The package-manager command reference documents additional filtering options; consult it for the Android version and operation you need.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Force-stop an app

adb shell am force-stop PACKAGE

Replace PACKAGE with the app’s package identifier. This stops the app’s process and is useful when testing a cold launch or recovering a stuck app. It changes the app’s running state; it does not uninstall the app or erase its stored data.

Start an activity

adb shell am start -a android.intent.action.VIEW

This asks Android to launch an activity that can handle the view action. Without a data URI or other intent details, Android may show a resolver or report that no matching activity is available. For a specific app or content, provide the appropriate component or intent data for that test case; do not assume this generic action opens a particular screen.

Grant or revoke an app permission for testing

Permission changes affect what an app can do and are mainly useful for debugging or controlled tests. The package must declare the permission, and whether a grant or revoke operation is allowed depends on Android version and permission type.

adb shell pm grant PACKAGE android.permission.CAMERA
adb shell pm revoke PACKAGE android.permission.CAMERA

Replace PACKAGE with the target app’s package identifier. The first command attempts to grant camera permission; the second attempts to revoke it. Check the result on the device and in the app, because manifest declarations and Android’s permission rules can prevent a requested change. The official command details are in the ADB documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install, push, and pull files

Install an APK

adb install path/to/app.apk

Run this on the workstation, replacing the path with the APK file’s location. For a test APK, Android notes that installation requires the -t option:

adb install -t path/to/test-app.apk

Copy files between the computer and Android

pull copies from the device to the workstation; push copies from the workstation to the device.

adb pull /sdcard/Download/example.txt ./example.txt
adb push ./example.txt /sdcard/Download/example.txt

Check that the source exists and that the destination is accessible. Shared-storage paths and access behavior can depend on the device and Android version. When multiple targets are connected, add -s SERIAL immediately after adb to avoid copying to or from the wrong one.

Capture and retrieve a device screenshot

Capture the display on the device and stream the PNG bytes directly to a workstation file:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
adb exec-out screencap -p > screen.png

The redirection is performed by your workstation shell, while screencap -p runs on the device. Use a filename ending in .png because the command emits PNG data. This is useful for a real Android screen, including app states that exist only on the device.

An alternative is to save a screenshot on the device and then retrieve it:

adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png ./screen.png

This two-step method leaves a file on shared storage until you remove it. The streamed exec-out version avoids that intermediate file.

Read and filter Android logs

Start with the full log stream when you do not yet know which tag or priority is relevant:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
adb logcat

Logcat output can be extensive. A filter expression specifies a minimum priority for a tag; *:S suppresses tags not named elsewhere. For example:

adb logcat ActivityManager:I MyApp:D *:S
adb logcat *:W

The first command shows ActivityManager messages at Info and above, MyApp messages at Debug and above, and suppresses other tags. The second shows messages at Warning and above. In shells that expand wildcard characters, quote expressions containing *, for example adb logcat 'ActivityManager:I MyApp:D *:S'. Logcat flags and available options differ by Android version; some options require root. See Android’s Logcat documentation.

Approach Use it when Trade-off
Unfiltered adb logcat You are exploring an unfamiliar failure or need surrounding context. Produces a large stream that can obscure the relevant event.
Tag and priority filters You know the component or severity to inspect. Can hide useful messages if the tag or threshold is wrong; shell quoting may be needed.

Quoting and commands that change device state

Arguments pass through both the workstation shell and the remote Android shell. Spaces and special characters may therefore need careful quoting. Android documents changed argument handling in Platform Tools 23 and later; test commands with harmless values before using them in a destructive operation. For example, a path containing a space should be quoted so it remains one argument, but the exact quoting needed depends on the workstation shell and the remote command.

Pause before running commands that uninstall an app, clear its data, disable a package, change permissions, or alter system properties or install locations. These operations can change app behavior or remove data. Android specifically warns that changing the install location is intended for debugging and can break apps or cause other undesirable effects. Confirm the target serial and the intended package or path before proceeding.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common ADB problems

adb devices shows no device

  • Confirm USB debugging is enabled and the device is unlocked.
  • Try a cable and ports known to support data, not just charging.
  • Reconnect the device, then run adb devices again. For wireless use, confirm pairing and the same-network requirement in Android’s wireless debugging flow.

The device is marked unauthorized

  • Look for the RSA debugging approval prompt on the device and approve only a trusted computer.
  • If no prompt appears, unlock the device and reconnect it, then check the device’s debugging settings.

A command affects the wrong device

Run adb devices, identify the intended serial, and rerun the command with -s SERIAL. This is especially important for install, permission, process, file, and shell operations.

ADB hangs or stops responding

Restart the workstation-side ADB server:

adb kill-server
adb devices

Android documents that another ADB command starts the server again after adb kill-server.

A shell utility or option is missing

Android builds do not all expose identical tools or flags. Check the device’s help output and inspect /system/bin; consult the relevant Android reference for version-dependent behavior. Logcat options in particular vary, and some require root.

A permission grant or APK install fails

For a permission operation, verify the package identifier, manifest declaration, permission type, and Android-version constraints. For a test APK, retry with adb install -t when applicable. Read the actual error output rather than assuming that a command succeeded.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Or skip the browser setup

ADB’s screencap captures an Android device display. If your task is instead to capture a website from a URL, ScreenshotNeo is a website screenshot API and MCP server for developers. Its one-call API returns a screenshot or PDF; before capture it accepts consent banners and removes known consent platforms, newsletter popups, and chat widgets. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with verdict and billing headers in each response. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. See the ScreenshotNeo site and API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. Every feature is on every plan. Sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Can ADB control an Android emulator as well as a phone?

Yes. ADB communicates with devices and emulators; use adb devices to see which targets are available.

Does a successful ADB command always mean the requested change happened?

No. Check the command output and verify the resulting state on the device, particularly for permission changes and operations subject to Android-version or manifest constraints.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.