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

What are the essential ADB shell commands for Android? Start with adb devices to verify the connection, select a specific serial when necessary, and then use adb shell commands such as pm, am, getprop, df, push, pull, screencap, and logcat. ADB commands run on your computer; commands after adb shell run on Android. This distinction helps you predict syntax, permissions, and side effects.

What ADB is and how a command reaches Android

Android Debug Bridge (ADB) is a command-line tool for communicating with an Android phone, tablet, TV, Wear OS device, or emulator. It is included in Android SDK Platform Tools. The system has three parts: an ADB client that you run on your workstation, an ADB server on that workstation, and an adbd daemon on the Android device. The connection exposes a device shell as well as installation, file-transfer, and diagnostic operations.

Install or update Platform Tools through Android Studio’s SDK Manager, the sdkmanager command-line tool, or Google’s standalone Platform Tools download. Platform Tools updates are designed to remain backward compatible with earlier Android platform versions.

Connect a device safely

USB debugging

  1. On Android, open Settings and enable Developer options if they are hidden. In Developer options, turn on USB debugging.
  2. Connect with a USB cable that supports data transfer. Check that the connector fits both your device and computer; not every cable carries data.
  3. On your workstation, run adb devices.
  4. Unlock the device and accept the RSA debugging prompt. Android 4.2.2 (API 17) and later require this approval for a computer key.
adb devices

A device shown as device is ready. unauthorized means the RSA prompt has not been accepted; offline usually indicates a stale or interrupted connection.

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.

Wireless debugging

Android phones support the modern Wireless debugging workflow from Android 11 (API 30), using pairing and a shared network. The exact menu labels differ by manufacturer. Android’s stated minimum for TV and Wear OS is Android 13 (API 33). Wireless mode is useful when a cable is inconvenient, but pairing and same-network requirements make USB the simpler first choice.

Choose the intended target

Never assume the default target when more than one phone or emulator is attached. Use the serial printed by adb devices:

adb -s SERIAL shell

-d selects a connected hardware device and -e selects an emulator when those selectors are unambiguous. Explicit targeting is especially important for commands that install, uninstall, clear data, change permissions, or stop applications.

Enter and identify the Android shell

Open an interactive shell

adb shell

You can leave it with exit. For a one-off command, put the device command after adb shell:

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.
adb shell getprop ro.build.version.release

getprop prints Android system properties. Output and available utilities vary by build. To discover commands on a particular device, use the shell’s help output and inspect commonly available programs in /system/bin. A command that works on one manufacturer’s build may be absent or restricted on another.

Quoting across two shells

Your computer’s shell parses the first time, and Android’s shell parses again. Platform Tools 23 and later changed argument handling to make this more predictable, but spaces and special characters still require care. Quote the complete remote expression when passing a value containing spaces:

adb shell 'echo "two words"'

Test destructive commands with harmless arguments first, and remember that Windows PowerShell, Command Prompt, macOS, and Linux have different local quoting rules.

Inspect storage, files, and basic state

List shared storage and check capacity

adb shell ls /sdcard
adb shell df -h

ls lists a directory; df -h reports filesystem capacity in readable units. Android permissions and storage restrictions can limit what you see. The shared-storage path is commonly exposed as /sdcard, but it is not the same as unrestricted access to private app directories.

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

List installed packages

adb shell pm list packages

The device-side package manager, pm, can also narrow results with package-manager options documented for the Android version on the device. Capture the exact package name before using a later command; display names are not reliable identifiers.

Manage applications with pm and am

These commands change application state. Read the package name twice and target the correct device before executing them.

Install an APK

adb install path/to/app.apk

For a test APK, Android documents adding -t:

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

Installation can fail because of signing conflicts, an incompatible SDK, insufficient storage, or device policy. The command’s error text is usually the first diagnostic clue.

Start an activity

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

am is the activity manager. This example asks Android to resolve a view action; without a data URI, the result depends on installed handlers. For deterministic automation, provide the package, component, action, and data your test requires.

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

Stop an application

adb shell am force-stop PACKAGE

This stops the package and its associated processes. It is useful for resetting a test before relaunching, but it can discard in-progress work.

Grant or revoke a runtime permission

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

Grant and revoke work only when the Android version permits the operation and the application declares the permission. They are primarily testing and debugging tools. A change can alter application behavior immediately; do not use it as a substitute for normal user consent or production policy.

Commands that need extra caution

Uninstalling, clearing app data, disabling a package, changing properties, and changing install location are state-changing operations. Android specifically warns that changing install location is intended for debugging and can break applications or cause other undesirable effects. Verify the serial and record a recovery path before using such commands.

Transfer files between the computer and Android

Copy from Android to the workstation

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

Copy from the workstation to Android

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

The destination must be writable, and Android’s scoped-storage rules can affect application-specific paths. For large transfers, keep the device awake and use a stable cable or network connection. A successful command reports the transferred file and byte count; verify the destination when automation depends on it.

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

Capture screenshots

Stream a PNG directly to your workstation

adb exec-out screencap -p > screen.png

exec-out is intended for a single stream without the extra transport formatting used by an interactive shell. The device-side screencap -p writes PNG data, which the workstation redirects to screen.png.

Save on the device, then retrieve it

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

The streamed form avoids leaving a temporary file. If the resulting image is empty or corrupted, check that the display is available, repeat without shell-specific redirection, and confirm that your local shell did not interpret the binary output.

Read and filter logs with Logcat

See the live stream

adb logcat

Logcat prints Android’s system and application logs. Unfiltered output is useful briefly, but it becomes difficult to scan on an active device.

Filter by tag and minimum priority

adb logcat ActivityManager:I MyApp:D *:S

This expression requests informational messages from ActivityManager, debug-and-higher messages from MyApp, and silences all other tags. In shells that expand *, quote the expression:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
adb logcat 'ActivityManager:I MyApp:D *:S'

Show warnings and errors

adb logcat '*:W'

Priority letters and available options depend on the device’s Android release. Some Logcat options require root access, and production builds may restrict visibility. Treat logs as potentially sensitive: they can contain URLs, identifiers, and application data.

USB or wireless: which connection should you use?

Factor USB debugging Wireless debugging
Minimum version stated in Android guidance Available through the standard USB-debugging workflow; the RSA approval requirement applies on Android 4.2.2/API 17 and later Phones: Android 11/API 30; TV and Wear OS: Android 13/API 33
Physical cable Required during connection Not required after pairing
Network No same-network requirement Pairing and the computer and device on the same network
Best starting point Most predictable setup and recovery Convenient for repeated work where cable access is awkward
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common ADB failures

adb devices shows no device

  • Confirm USB debugging is enabled and the phone is unlocked.
  • Try a known data-capable cable and another USB port.
  • Accept the RSA prompt; revoke USB-debugging authorizations in Developer options and reconnect if the prompt is stuck.
  • On wireless debugging, repeat pairing and verify both devices share the required network.

The device is unauthorized

Unlock Android and accept the computer-key prompt. If no prompt appears, disconnect, revoke authorizations, reconnect, and run adb devices again.

The device is offline or ADB hangs

Restart the workstation ADB server:

adb kill-server
adb devices

The next ADB command starts the server again. Reconnect the cable or repeat wireless pairing if the state persists.

A command says permission denied or unknown command

Many shell utilities are build-dependent, and private paths normally require privileges unavailable to a regular shell. Check the command’s device-side help, inspect /system/bin, and avoid assuming root access. For pm grant, confirm that the package declares the permission and that the Android release supports granting it through ADB.

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

The wrong device changed

Stop and rerun adb devices. Use -s SERIAL on every subsequent command, including installation, file transfer, and shell operations.

Or skip the browser setup

If your goal is a clean screenshot of a website rather than an Android display, ScreenshotNeo provides a one-request alternative:

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

See the ScreenshotNeo documentation for all parameters. Before capture it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server supplies take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Quick reference

Purpose Command
List targets adb devices
Target a serial adb -s SERIAL shell
List packages adb shell pm list packages
Start an activity adb shell am start -a android.intent.action.VIEW
Stop a package adb shell am force-stop PACKAGE
Install an APK adb install path/to/app.apk
Transfer files adb pull REMOTE LOCAL and adb push LOCAL REMOTE
Capture PNG adb exec-out screencap -p > screen.png
Read logs adb logcat

Frequently Asked Questions

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

Yes. ADB communicates with both connected Android devices and emulators; use the serial shown by adb devices when more than one target exists.

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

Why does my Logcat filter show nothing?

The tag, priority, or suppression rule may exclude the message, or the device may restrict visibility. Temporarily run adb logcat, then add filters one tag at a time.

Are ADB shell commands portable across Android brands?

Core ADB operations are broadly consistent, but device-side utilities, output, permissions, and available options vary by Android release and manufacturer build.

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.