ADB Commands Reference
Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps.
adb devicesQueries the ADB server and displays all detected Android devices and emulators along with their connection state.
adb devices -lOutputs all connected devices including their hardware product code, device codename, marketing model, and transport ID.
adb connect <ip>:<port>Establishes a wireless ADB connection to an Android device over TCP/IP using its IP address and listening port (default 5555).
adb disconnect [ip:port]Terminates an active TCP/IP wireless ADB connection to a specific device, or disconnects all TCP devices if no address is supplied.
adb pair <ip>:<port> [pairing_code]Pairs a computer with an Android 11+ device using TLS authentication and a 6-digit one-time pairing code from Developer Options.
adb wait-for-deviceBlocks command execution until the connected device is fully booted and accepted by the ADB daemon. Essential for automation and CI/CD pipelines.
adb get-stateReturns the current low-level ADB transport status of the connected device: offline, bootloader, or device.
adb get-serialnoOutputs the unique hardware serial number assigned to the connected Android device.
adb start-serverLaunches the local ADB host background server on localhost port 5037 if it is not already running.
adb kill-serverKills the local ADB background daemon process. Resolves hung connections, unresponsive states, and stuck USB ports.
adb install <path_to_apk>Pushes an APK file to the device and invokes the package manager to install it.
adb install-multiple <apk1> <apk2> ...Installs multi-split APK packages (base.apk plus config and density splits) in a single atomic atomic session.
adb uninstall <package_name>Removes the installed application package and deletes its private data directories from /data/data.
adb shell pm list packagesQueries the Package Manager service and prints the complete list of package names installed on the system.
adb shell pm path <package_name>Prints the physical filesystem path where the base APK and splits for the specified package are stored on the Android filesystem.
adb shell pm clear <package_name>Clears all user data, database records, shared preferences, and cache files associated with a package, resetting it to factory fresh install state.
adb shell pm disable-user --user 0 <package_name>Disables a pre-installed carrier or OEM bloatware app for the primary user without requiring root privileges.
adb shell pm enable <package_name>Re-activates a frozen or disabled application package, restoring its launcher icon and background services.
adb push <local_path> <remote_path>Transfers a file or folder from the host development machine to a specified path on the Android filesystem.
adb pull <remote_path> [local_path]Downloads a file or directory tree from the Android device to the specified local directory on the host computer.
adb shell ls -la <path>Lists all files, hidden items, owner permissions, SELinux contexts, and timestamps inside an Android directory.
adb shell rm -rf <path>Deletes a file or directory tree from the Android storage volume.
adb shell df -hDisplays storage statistics, free space, and mount points across all mounted Android filesystem partitions in human-readable units.
adb shellLaunches an interactive pseudo-terminal shell session directly on the target Android operating system.
adb shell getprop [key]Reads Android runtime properties from the system property store, or dumps all system properties if no key is provided.
adb shell setprop <key> <value>Sets a runtime system property in the Android init environment. Useful for testing debug flags, mock sensors, and developer parameters.
adb shell whoamiDisplays the user ID name running the current ADB shell process (e.g. shell, root, or u0_a...).
adb shell am start -n <package>/<activity>Uses Activity Manager to launch an explicit Android activity by its full package and component name.
adb shell am start -a android.intent.action.VIEW -d <url>Dispatches an implicit VIEW intent to test deep links, universal links, or open a web page in the default web browser.
adb shell am force-stop <package_name>Terminates all processes, background services, alarms, and notifications associated with the specified package immediately.
adb shell input keyevent <keycode>Sends a simulated hardware key code event to the device window manager (e.g. Home, Back, Power, Volume).
adb shell input text <string>Types a sequence of characters into whichever text input or edit field currently has focus on the Android screen.
adb shell input tap <x> <y>Simulates a finger tap event at the specified pixel coordinates (X, Y) on the display.
adb shell input swipe <x1> <y1> <x2> <y2> [duration_ms]Simulates a finger drag or swipe motion from starting coordinates (x1, y1) to ending coordinates (x2, y2). Useful for scrolling and drag-and-drop.
adb bugreport [zip_file]Captures a complete snapshot of system diagnostics, dumpsys logs, battery history, ANR traces, and radio states into a ZIP archive.
adb logcatStreams continuous real-time diagnostic output from the Android log ring buffer.
adb logcat -cFlushes and empties the entire Android log ring buffer history so subsequent logcat commands show only fresh events.
adb logcat *:EFilters the system log stream to isolate critical system and application exceptions and errors (log level Error & Fatal).
adb logcat -d > log.txtDumps the current contents of the circular log buffer to a local text file on the development computer and exits.
adb exec-out screencap -p > screenshot.pngCaptures the active Android screen framebuffer and pipes the PNG stream directly to a file on your local machine without needing intermediate device storage.
adb shell screencap -p /sdcard/screenshot.pngCaptures a screenshot and saves it as an image file on the internal SD card storage.
adb shell screenrecord /sdcard/demo.mp4Records high-definition screen video of device activity to an MP4 video file on the device. Press Ctrl+C to terminate recording.
adb rebootRestarts the Android operating system into normal user mode.
adb reboot bootloaderReboots the device into the bootloader interface where low-level Fastboot flashing commands can be executed.
adb reboot recoveryReboots the device into Android recovery console (Stock Recovery or custom TWRP/OrangeFox) for OTAs and wipes.
adb reboot fastbootReboots Android 10+ devices into fastbootd (userspace fastboot), allowing partition resizing and flashing dynamic logical partitions (system, vendor, product).
adb reboot edlReboots Qualcomm-based Snapdragon devices directly into Emergency Download (EDL / 9008) mode for low-level unbricking.
adb sideload <update.zip>Sends and installs a full OTA package or custom ROM ZIP archive to a device booted into Recovery Mode with "Apply update from ADB" active.
adb shell pm grant <package> <permission>Grants a declared runtime permission (e.g. WRITE_SECURE_SETTINGS, ACCESS_FINE_LOCATION) to an app without user prompt.
adb shell pm revoke <package> <permission>Revokes a previously granted runtime permission from the specified application.
adb shell pm reset-permissionsResets all granted runtime permissions for all installed applications back to default factory states.
adb tcpip 5555Instructs the connected device to listen for ADB connections on network TCP port 5555, allowing USB cable removal for wireless debugging.
adb forward tcp:<local_port> tcp:<remote_port>Sets up socket forwarding from a port on the host computer to a port or socket on the Android device.
adb reverse tcp:<remote_port> tcp:<local_port>Allows network requests originating on the Android device to route back into a server running on your computer localhost (e.g. dev server on port 3000).
adb forward --listDisplays all currently established local-to-remote socket forwarding tunnels.
adb shell dumpsys batteryPrints current battery charge level, voltage, battery temperature, health status, and charging source (AC/USB/Wireless).
adb shell dumpsys battery set level <percentage>Overrides Android OS battery percentage reporter for testing low-battery notifications and power-saving modes.
adb shell dumpsys meminfo [package_name]Dumps deep RAM allocation statistics including Native Heap, Dalvik Heap, Graphics buffers, and PSS memory for an app or the whole system.
adb shell dumpsys cpuinfoOutputs CPU workload percentages consumed by individual apps, system services, and kernel threads over the recent sampling window.
adb shell wm size [widthxheight|reset]Reads the physical display resolution or overrides it to test responsive UI layouts across various screen resolutions.
adb shell wm density [dpi|reset]Adjusts the software DPI (density-independent dots per inch) scale factor of the Android display.
adb rootRestarts the on-device adbd daemon with root privileges (available on userdebug, eng, or rooted custom firmware builds).
adb unrootRestarts the on-device adbd daemon back into unprivileged standard shell user context.
adb remountRemounts /system, /vendor, and /product partitions as read-write, enabling manual modification of system binaries and APKs.
adb disable-verityDisables Device Mapper Verity (dm-verity) cryptographic block integrity enforcement on userdebug builds to allow system partition modifications.