adb
Android Platform Tools 34+Quick reference for the Android Debug Bridge CLI: device discovery, install / uninstall, logcat, shell, push / pull, port forwarding, and wireless debugging — with common options and practical examples.
33 commands
Devices
adb devicesList every connected device / emulator with serial and state (`device`, `unauthorized`, `offline`).
-l show long detail (product, model, transport); -e only emulators; -d only USB devices
adb devices -ladb connect <ip>:<port>Connect to a device over Wi-Fi or TCP/IP (default port 5555). Pair first with `adb pair <ip>:<port>` for Android 11+.
ip:port; --one-time disconnect on session end
adb pair 192.168.1.42:41235 && adb connect 192.168.1.42:5555adb disconnect [<ip>:<port>]Disconnect from one or every wireless device. Pass no argument to drop all connections.
adb disconnect 192.168.1.42:5555 && adb disconnectadb -s <serial> <command>Target a specific device when multiple are attached (replace `<serial>` with the value from `adb devices`).
adb -s emulator-5554 shell pm list packagesInstall / Uninstall
adb install <apk>Install an APK. `-r` reinstalls keeping data; `-d` allows version-code downgrade; `-t` allows test-only APKs; `-g` grants all runtime permissions.
-r; -d; -t; -g; --abi <abi>; --user <id>
adb install -r -g app-release.apkadb install-multi-package <apk1> <apk2>Install a split APK bundle atomically — used for App Bundles with multiple ABIs / configs.
adb install-multi-package base.apk split_config.arm64.apkadb uninstall <package>Uninstall an app by package name. `-k` keeps data + cache directories.
-k keep user data
adb uninstall com.example.myappLogcat
adb logcatStream the device's log buffer. Tag / priority filters: `*:V` (verbose), `*:E` (errors).
-v threadtime; -d dump and exit; -s <tag>; -t <N>; --pid=<pid>; -f <file> write to file
adb logcat *:Eadb logcat -dDump the current buffer to stdout and exit (non-streaming). Combine with grep for one-off inspection.
-d -t 500 last 500 lines
adb logcat -d -t 200 | grep -i 'myapp'adb logcat -s <tag>:<level>Show only entries for a specific tag at a given level (V/D/I/W/E). Combine tags with whitespace.
MyTag:D MyTag2:E
adb logcat -s MyApp:V ReactNative:VShell
adb shellDrop into an interactive shell on the device. Most Unix utilities work; `/sdcard` is the public storage root.
-t allocate a TTY (for interactive programs)
adb shelladb shell <command>Run a single command on the device and return the output. Quote carefully when mixing host / device args.
adb shell pm list packages | grep com.example && adb shell dumpsys batteryadb shell pm list packagesList installed packages. `-f` shows path, `-3` filters to user-installed apps, `-d` filters to disabled packages.
-f path; -3 user apps; -d disabled; -e enabled; -s system; <filter>
adb shell pm list packages -3 | head -30adb shell am start -n <package>/<activity>Launch an activity by its `package/activity` qualified name. Use `am start -W` to wait for the launch to complete.
-a <action>; -d ; --es <key> <val> extra string; -W wait
adb shell am start -n com.example/.MainActivityadb shell screencap -p /sdcard/screen.pngCapture the device screen to a PNG. Pair with `adb pull` to retrieve.
-p PNG (default)
adb shell screencap -p /sdcard/screen.png && adb pull /sdcard/screen.png .adb shell input <source> <command>Inject input events. Common: `tap x y`, `swipe x1 y1 x2 y2 [ms]`, `keyevent <code>`, `text "string"`.
tap; swipe; keyevent; text; roll; press
adb shell input tap 540 1200 && adb shell input keyevent 4File transfer
adb push <local> <remote>Copy a local file / directory to the device. Sync semantics; preserves binary files.
--sync overwrite only stale files; --copy-links preserve symlinks; -p show progress
adb push app-debug.apk /sdcard/Download/ && adb push ./assets /sdcard/myapp/assetsadb pull <remote> <local>Copy a device file / directory to the host. Default destination is `.` (current directory).
-a preserve timestamps; -p show progress
adb pull /sdcard/screen.png ./screenshots/latest.pngForwarding
adb forward tcp:<host-port> tcp:<device-port>Forward a host port to a device port — common for opening a Chrome remote-debug socket against a Chrome tab.
--remove; --remove-all
adb forward tcp:9222 localabstract:chrome_devtools_remoteadb reverse tcp:<device-port> tcp:<host-port>Reverse-forward a device port to a host port — useful when your dev server runs on `localhost:3000` and the device needs to hit it.
adb reverse tcp:3000 tcp:3000 && curl http://localhost:3000/api/healthadb forward --listList active port forwards and reverses. Pair with `adb forward --remove-all` to reset.
adb forward --list && adb reverse --listApp management
adb shell pm clear <package>Wipe app data + cache for a specific package — the same effect as `Settings → Apps → Storage → Clear`.
adb shell pm clear com.example.myappadb shell pm grant <package> <permission>Grant a runtime permission (e.g. `android.permission.CAMERA`) without UI prompts — common in test setups.
adb shell pm grant com.example.myapp android.permission.READ_CONTACTSadb shell am force-stop <package>Force-stop a running app (its process is killed). Useful when reinstalling a foreground app.
adb shell am force-stop com.example.myapp && adb install -r app.apkBoot / Recovery
adb rebootReboot the device. Variants: `recovery`, `bootloader`, `fastboot`, `download`, `edl`.
recovery | bootloader | fastboot | download | edl
adb reboot bootloader && fastboot flashalladb sideload <zip>Sideload a signed OTA / factory image zip from recovery mode (typically entered via `adb reboot recovery`).
adb sideload ota-update.zipDebugging
adb shell run-as <package> <cmd>Run a command as the app's UID — required for debuggable APKs to read their own private data directory.
<package> cat ./databases/my.db > /sdcard/dump.db
adb shell run-as com.example.myapp ls databasesadb shell dumpsys <service>Dump the state of a system service (`battery`, `window`, `activity`, `package`, `gfxinfo`, `netstats`).
battery; activity; package; window; gfxinfo <pkg>; netstats
adb shell dumpsys gfxinfo com.example.myapp framestatsServer
adb start-serverStart the adb server explicitly (it normally auto-starts on any command). Use after `kill-server`.
adb start-serveradb kill-serverStop the adb server and disconnect every device. Useful when adb gets stuck in `offline` state.
adb kill-server && adb start-server && adb devicesMisc
adb --versionPrint Platform Tools version.
adb --versionadb helpList every adb subcommand with one-line descriptions.
adb helpWireless
adb pair <ip>:<port>Pair with a device over Wi-Fi using the 6-digit pairing code shown in Developer Options. Then `adb connect` to the actual debug port.
<ip>:<port>
adb pair 192.168.1.42:41235Related command cheatsheets
Trademark & Use Notice
These command-line tool cheatsheets are open community references. The names, logos, and trademarks of the tools referenced here (such as Git™, Docker™, Kubernetes®, kubectl, PostgreSQL®, MySQL®, Redis™, MongoDB®, Linux™, PowerShell™, Vim™, and others) are the property of their respective owners and are used here solely for identification and reference purposes.
All content in these cheatsheets is independently authored as a simplified, self-contained reference. It is not affiliated with, endorsed by, or sourced from any official documentation. Command listings, flag descriptions, and examples are original simplifications; for authoritative information please consult the official documentation of each tool.
Command syntax and option flags may differ across tool versions. The version tags shown reflect stable releases; behavior may differ in other versions. This cheatsheet does not imply any preference or recommendation by the trademark holders.
If a trademark or copyright owner believes that any content on this site infringes their rights, please send an email to [email protected]. Upon receiving valid proof of rights, we will modify or remove the relevant content within a reasonable period.
This website assumes no legal liability for any direct or indirect losses arising from the use of information presented on these pages.
About ADB
The Android Debug Bridge (adb) is a command-line tool that ships with the Android SDK Platform Tools (since 2009). It bridges your development workstation to any Android device or emulator over USB, Wi-Fi, or TCP/IP, and exposes three sub-components: a server (runs on the host, port 5037), a daemon (`adbd` runs on the device), and the `adb` CLI. The current Platform Tools line is 34+ (released alongside Android 14). `adb` is the foundation for installing APKs, reading logcat, debugging apps via JDWP, sideloading ROMs, scripting UI tests, and pushing/pulling files. Wireless debugging was added in Android 11 (with QR-pair flow in 13+). Common sibling commands include `fastboot` (bootloader / recovery) and `emulator` (QEMU-based AVDs). ADB never uploads your app's source code — it ships APKs and device state. SDK Platform Tools is licensed under Apache 2.0 and is available as a standalone ZIP or via the SDK Manager.
Cheatsheet version 1.0.0