Other

ADB Commands: Complete Cheat Sheet for Android (2026)

This cheat sheet compiles essential ADB commands for working with Android devices. Find commands for app installation, file management, log viewing, and more.

Updated at February 16, 2026
5-10 min
Easy
FixPedia Team
Применимо к:Android 4.0+ADB platform-tools r30+

Introduction

ADB (Android Debug Bridge) is a powerful command-line tool for interacting with Android devices. It allows developers, testers, and advanced users to install apps, manage files, obtain system logs, execute shell commands on the device, and perform low-level operations. This cheat sheet compiles the most frequently used ADB and Fastboot commands to simplify debugging, administration, and everyday management of Android devices.

Requirements

Before you begin, ensure the following conditions are met:

  • Android SDK Platform-Tools are installed on your computer (they contain adb and fastboot). Download from the official Google website.
  • USB debugging is enabled on the Android device: Settings → About phone → Build number (tap 7 times) → Settings → Developer options → USB debugging.
  • The device is connected to the computer via a USB cable (original or high-quality alternative recommended).
  • For Windows, ADB/Fastboot drivers may be required (usually installed automatically or manually from the usb_driver folder).
  • The PATH environment variable must include the platform-tools folder (or run commands from within that folder).

Basic Device Interaction Commands

These commands form the foundation for any interaction with a device via ADB. They allow you to check connectivity, manage device state, copy files, and install apps.

CommandDescriptionExample
adb devicesShow list of connected devices and their status (device, offline, unauthorized)adb devices
adb shellOpen an interactive shell on the device. To exit: exitadb shell
adb rebootReboot the device into normal modeadb reboot
adb reboot recoveryReboot into Recovery modeadb reboot recovery
adb reboot bootloaderReboot into Bootloader (Fastboot) modeadb reboot bootloader
adb pull <remote> <local>Copy a file or folder from the device to the computeradb pull /sdcard/file.txt ./file.txt
adb push <local> <remote>Copy a file or folder from the computer to the deviceadb push ./file.txt /sdcard/
adb install <apk>Install an APK file on the device. Flag -r reinstalls, -t allows test APKsadb install -r app.apk
adb uninstall <package>Uninstall an app by its package name (e.g., com.example.app)adb uninstall com.example.app
adb shell pm list packagesList all installed packages. Flag -3 shows only third-party appsadb shell pm list packages -3

App Management

These commands allow you to manage the app lifecycle, obtain information about apps, and perform actions without a graphical interface.

CommandDescriptionExample
adb shell am start -n <package>/<activity>Launch a specific app activityadb shell am start -n com.android.settings/.Settings
adb shell am force-stop <package>Force-stop an appadb shell am force-stop com.example.app
adb shell pm clear <package>Clear app data (reset to "as installed" state)adb shell pm clear com.example.app
adb shell pm disable-user --user 0 <package>Disable an app for the current user (without uninstalling)adb shell pm disable-user --user 0 com.example.app
adb shell pm enable <package>Enable a previously disabled appadb shell pm enable com.example.app
adb shell dumpsys package <package>Get detailed package info: permissions, activities, servicesadb shell dumpsys package com.example.app
adb shell monkey -p <package> -v 1000Perform 1000 random events in the app (stress test)adb shell monkey -p com.example.app -v 500

File System Operations

Commands for navigating, viewing, and manipulating files and folders on the device.

CommandDescriptionExample
adb shell ls /pathList files and folders in the specified directoryadb shell ls /sdcard/
adb shell mkdir /pathCreate a new directoryadb shell mkdir /sdcard/new_folder
adb shell rm /pathDelete a file. Use flag -r for foldersadb shell rm /sdcard/file.txt
adb shell cp <from> <to>Copy a file or folderadb shell cp /sdcard/file.txt /sdcard/backup/
adb shell mv <from> <to>Move or rename a file/folderadb shell mv /sdcard/old.txt /sdcard/new.txt
adb shell cat /pathOutput the contents of a text file to the terminaladb shell cat /sdcard/log.txt
adb shell chmod <permissions> <file>Change access permissions (e.g., 755 for an executable script)adb shell chmod 755 /sdcard/script.sh
adb shell dfShow free space information on partitionsadb shell df

Debugging and Logs

Commands for obtaining system information, monitoring activity, and analyzing logs.

CommandDescriptionExample
adb logcatShow system log in real-time. To exit: Ctrl+Cadb logcat
adb logcat -s <tag>Filter log by tag (e.g., ActivityManager, MyApp)adb logcat -s MyApp
adb logcat -d > log.txtSave the current log to a log.txt file on the computeradb logcat -d > log.txt
adb shell dumpsysDump information about all system servicesadb shell dumpsys
adb shell dumpsys batteryGet battery statusadb shell dumpsys battery
adb shell getpropGet a system property value (build parameters, settings)adb shell getprop ro.build.version.release
`adb shell getpropgrep `Find a property by keyword
adb shell wm sizeGet the current screen resolutionadb shell wm size
adb shell wm densityGet pixel density (dpi)adb shell wm density
adb shell settings get <namespace> <key>Get a setting value (e.g., brightness)adb shell settings get system screen_brightness

Fastboot Commands

Fastboot is used when the device is booted into the bootloader. Commands are executed via the fastboot utility (included in Platform-Tools). To enter fastboot: adb reboot bootloader.

CommandDescriptionExample
fastboot devicesShow devices in fastboot modefastboot devices
fastboot rebootReboot the device into the normal systemfastboot reboot
fastboot reboot recoveryReboot into Recovery modefastboot reboot recovery
fastboot flash <partition> <image>Flash a specific partition with an imagefastboot flash boot boot.img
fastboot flash recovery recovery.imgFlash a custom recoveryfastboot flash recovery recovery.img
fastboot erase <partition>Erase a partition (e.g., userdata, cache)fastboot erase userdata
fastboot oem unlockUnlock the bootloader (all data on the device will be erased!)fastboot oem unlock
fastboot oem lockLock the bootloader (return to stock state)fastboot oem lock
fastboot getvar <variable>Get a bootloader variable (e.g., product, version)fastboot getvar product
fastboot flash:raw boot <boot.img>Alternative flashing method (for some devices)fastboot flash:raw boot boot.img

⚠️ Important: Fastboot commands can render a device unusable (brick). Always read the documentation for your specific model, ensure image compatibility, and have sufficient battery charge (at least 50%).

Verifying Results

After executing any ADB/Fastboot command, the result is displayed in the terminal:

  • Success: Many commands produce no output on success (e.g., adb install). Verify indirectly (app installed, file appeared).
  • Device status: adb devices should list your device with status device. If unauthorized — confirm the prompt on the device.
  • Logs: For commands that should produce output (e.g., adb shell getprop), check that the output matches expectations.
  • Permissions: Some commands require superuser (root) privileges. If you get Permission denied, try adb root (on user builds) or adb shell su -c <command> (if the device is rooted).

Common Issues

Device not showing up in adb devices

  • Cause: USB debugging not enabled or confirmed, faulty cable/port, missing drivers.
  • Solution:
    1. Check if USB debugging is enabled in Developer options.
    2. Reconnect the cable, try a different port or cable.
    3. On Windows: install ADB drivers (e.g., via Universal ADB Drivers) or restart the ADB server: adb kill-server && adb start-server.
    4. On the device, change the USB mode to "File Transfer (MTP)" or "PTP".

"device offline" error

  • Cause: ADB server cannot establish a connection with the device.
  • Solution:
    1. Disconnect and reconnect the device, confirm the debugging prompt.
    2. Restart ADB: adb kill-server && adb start-server.
    3. Reboot both the device and the computer.

"error: closed" or "no devices/emulators"

  • Cause: ADB server is not running or port 5037 (default for ADB) is in use.
  • Solution: Run adb start-server or terminate processes using port 5037.

Fastboot does not recognize the device

  • Cause: Device not in fastboot mode, missing drivers (Windows), cable does not support data transfer.
  • Solution:
    1. Ensure the device screen shows the fastboot logo (usually a black screen with text).
    2. For Windows: install fastboot drivers (e.g., from the usb_driver folder in Platform-Tools or via Zadig).
    3. Try a different USB port (USB 2.0 preferred) and cable.

"Permission denied" when running commands in adb shell

  • Cause: Command requires superuser (root) privileges, but the device is not rooted.
  • Solution:
    1. Obtain root access on the device (if supported).
    2. Use adb shell su -c "<command>" to execute the command as root.
    3. For some system commands (e.g., setprop), a reboot into ADB root mode is required: adb root (works only on user builds like AOSP).

APK installation does not complete

  • Cause: Insufficient storage, permission conflict, or corrupted APK.
  • Solution:
    1. Check free space: adb shell df.
    2. Install with the -r flag to reinstall: adb install -r app.apk.
    3. Ensure the APK is compatible with the device's architecture and Android version.
    4. Use adb logcat during installation for debugging.

F.A.Q.

How do I install ADB on my computer?
What's the difference between adb and fastboot?
How to enable USB debugging on an Android device?
Which adb commands are most useful for beginners?

Hints

Install ADB on your computer
Enable USB debugging on the device
Connect the device to the computer
Execute the needed commands from the cheat sheet
Check the connection

Did this article help you solve the problem?

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