.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "" "" "" "" "" .hy .SH ADB(1) MAN PAGE .SH VERSION .PP 1.0.41 .SH NAME .PP \f[B]adb\f[R] \ \ \ \ CLI Client for ADB (Android Debug Bridge) Server. .SH SYNOPSIS .PP \f[B]adb\f[R] [\f[I]GLOBAL_OPTIONS\f[R]] command [\f[I]COMMAND_OPTIONS\f[R]] .SH DESCRIPTION .PP Connects to the ADB Server via its smart socket interface. Allows sending requests, receives responses and manages lifecycle of the adb server. .PP Tasks are performed via commands. Some commands are fulfilled directly by the server while others are \[dq]forwarded over to the adbd(ADB daemon) running on the device. .SH GLOBAL OPTIONS: .PP \f[B]-a\f[R] \ \ \ \ Listen on all network interfaces, not just localhost. .PP \f[B]-d\f[R] \ \ \ \ Use USB device (error if multiple devices connected). .PP \f[B]-e\f[R] \ \ \ \ Use TCP/IP device (error if multiple TCP/IP devices available). .PP \f[B]-s\f[R] \f[B]SERIAL\f[R] \ \ \ \ Use device with given \f[B]SERIAL\f[R] (overrides $ANDROID_SERIAL). .PP \f[B]-t\f[R] \f[B]ID\f[R] \ \ \ \ Use device with given transport \f[B]ID\f[R]. .PP \f[B]-H\f[R] \ \ \ \ Name of adb server host [default=localhost]. .PP \f[B]-P\f[R] **PORT* \ \ \ \ Smart socket \f[B]PORT\f[R] of adb server [default=5037]. .PP \f[B]-L\f[R] \f[B]SOCKET\f[R] \ \ \ \ Listen on given socket for adb server [default=tcp:localhost:5037]. .PP \f[B]--one-device\f[R] \f[B]SERIAL\f[R]|\f[B]USB\f[R] \ \ \ \ Server will only connect to one USB device, specified by a \f[B]SERIAL\f[R] number or \f[B]USB\f[R] device address (only with `start-server' or `server nodaemon'). .PP \f[B]--exit-on-write-error\f[R] \ \ \ \ Exit if stdout is closed. .SH GENERAL COMMANDS: .PP devices [\f[B]-l\f[R]] \ \ \ \ List connected devices. .PP \f[B]-l\f[R] \ \ \ \ Use long output. .PP help \ \ \ \ Show this help message. .PP version \ \ \ \ Show version number. .SH NETWORKING .PP connect \f[B]HOST\f[R][:\f[B]PORT\f[R]] \ \ \ \ Connect to a device via TCP/IP [default \f[B]PORT\f[R]=5555]. .PP disconnect [\f[B]HOST\f[R][:\f[B]PORT\f[R]]] \ \ \ \ Disconnect from given TCP/IP device [default \f[B]PORT\f[R]=5555], or all. .PP pair \f[B]HOST\f[R][:\f[B]PORT\f[R]] [\f[B]PAIRING_CODE\f[R]] \ \ \ \ Pair with a device for secure TCP/IP communication. .PP forward \f[B]--list\f[R] | [\f[B]\[en]no-rebind\f[R]] \f[B]LOCAL_REMOTE\f[R] | \f[B]--remove\f[R] \f[B]LOCAL\f[R] | \f[B]--remove-all\f[R] .PP \f[B]--list\f[R] \ \ \ \ List all forward socket connections. .PP [\f[B]\[en]no-rebind\f[R]] \f[B]LOCAL_REMOTE\f[R] \ \ \ \ Forward socket connection using one of the followings. .PP \ \ \ \ \f[B]tcp\f[R]:\f[B]PORT\f[R] (local may be \[lq]tcp:0\[rq] to pick any open port. \ \ \ \ \f[B]localreserved\f[R]:\f[B]UNIX_DOMAIN_SOCKET_NAME\f[R]. \ \ \ \ \f[B]localfilesystem\f[R]:\f[B]UNIX_DOMAIN_SOCKET_NAME\f[R]. \ \ \ \ \f[B]jdwp\f[R]:\f[B]PROCESS PID\f[R] (remote only). \ \ \ \ \f[B]vsock\f[R]:\f[B]CID\f[R]:\f[B]PORT\f[R] (remote only). \ \ \ \ \f[B]acceptfd\f[R]:\f[B]FD\f[R] (listen only). \ \ \ \ \f[B]dev\f[R]:\f[B]DEVICE_NAME\f[R]. \ \ \ \ \f[B]dev-raw\f[R]:\f[B]DEVICE_NAME\f[R]. (open device in raw mode)**. .PP \f[B]--remove\f[R] \f[B]LOCAL\f[R] \ \ \ \ Remove specific forward socket connection. .PP \f[B]--remove-all\f[R] \ \ \ \ Remove all forward socket connections. .PP reverse \f[B]--list\f[R] | [\f[B]--no-rebind\f[R]] \f[B]REMOTE\f[R] \f[B]LOCAL\f[R] | \f[B]--remove\f[R] \f[B]REMOTE\f[R] | \f[B]--remove-all\f[R] .PP \f[B]--list\f[R] \ \ \ \ List all reverse socket connections from device. .PP [\f[B]--no-rebind\f[R]] \f[B]REMOTE\f[R] \f[B]LOCAL\f[R] \ \ \ \ Reverse socket connection using one of the following. .PP \ \ \ \ tcp:\f[B]PORT\f[R] (\f[B]REMOTE\f[R] may be \[lq]tcp:0\[rq] to pick any open port). \ \ \ \ localabstract:\f[B]UNIX_DOMAIN_SOCKET_NAME\f[R]. \ \ \ \ localreserved:\f[B]UNIX_DOMAIN_SOCKET_NAME\f[R]. \ \ \ \ localfilesystem:\f[B]UNIX_DOMAIN_SOCKET_NAME\f[R]. .PP \f[B]--remove\f[R] \f[B]REMOTE\f[R] \ \ \ \ Remove specific reverse socket connection. .PP \f[B]--remove-all\f[R] \ \ \ \ Remove all reverse socket connections from device. .PP mdns \f[B]check\f[R] | \f[B]services\f[R] \ \ \ \ Perform mDNS subcommands. .PP \f[B]check\f[R] \ \ \ \ Check if mdns discovery is available. .PP \f[B]services\f[R] \ \ \ \ List all discovered services. .SH FILE TRANSFER: .PP push [\f[B]\[en]sync\f[R]] [\f[B]-z\f[R] \f[B]ALGORITHM\f[R]] [\f[B]-Z\f[R]] \f[B]LOCAL\f[R]\&... \f[B]REMOTE\f[R] \ \ \ \ Copy local files/directories to device. .PP \f[B]\[en]sync\f[R] \ \ \ \ Only push files that are newer on the host than the device. .PP \f[B]-n\f[R] \ \ \ \ Dry run, push files to device without storing to the filesystem. .PP \f[B]-z\f[R] \ \ \ \ enable compression with a specified algorithm (any/none/brotli/lz4/zstd). .PP \f[B]-Z\f[R] \ \ \ \ Disable compression. .PP pull [\f[B]-a\f[R]] [\f[B]-z\f[R] \f[B]ALGORITHM\f[R]] [\f[B]-Z\f[R]] \f[B]REMOTE\f[R]\&... \f[B]LOCAL\f[R] \ \ \ \ Copy files/dirs from device .PP \f[B]-a\f[R] \ \ \ \ preserve file timestamp and mode. .PP \f[B]-z\f[R] \ \ \ \ enable compression with a specified algorithm (\f[B]any\f[R]/\f[B]none\f[R]/\f[B]brotli\f[R]/\f[B]lz4\f[R]/\f[B]zstd\f[R]) .PP \f[B]-Z\f[R] \ \ \ \ disable compression .PP sync [\f[B]-l\f[R]] [\f[B]-z\f[R] \f[B]ALGORITHM\f[R]] [\f[B]-Z\f[R]] [\f[B]all\f[R]|\f[B]data\f[R]|\f[B]odm\f[R]|\f[B]oem\f[R]|\f[B]product\f[R]|\f[B]system\f[R]|\f[B]system_ext\f[R]|\f[B]vendor\f[R]] \ \ \ \ Sync a local build from $ANDROID_PRODUCT_OUT to the device (default all) .PP \f[B]-n\f[R] \ \ \ \ Dry run. Push files to device without storing to the filesystem. .PP \f[B]-l\f[R] \ \ \ \ List files that would be copied, but don\[cq]t copy them. .PP \f[B]-z\f[R] Enable compression with a specified algorithm (\f[B]any\f[R]/\f[B]none\f[R]/\f[B]brotli\f[R]/\f[B]lz4\f[R]/\f[B]zstd\f[R]) .PP \f[B]-Z\f[R] Disable compression. .SH SHELL: .PP shell [\f[B]-e\f[R] \f[B]ESCAPE\f[R]] [\f[B]-n\f[R]] [\f[B]-Tt\f[R]] [\f[B]-x\f[R]] [\f[B]COMMAND\f[R]\&...] \ \ \ \ Run remote shell command (interactive shell if no command given). .PP \f[B]-e\f[R] \ \ \ \ Choose escape character, or \[lq]\f[B]none\f[R]\[rq]; default `\f[B]\[ti]\f[R]'. .PP \f[B]-n\f[R] \ \ \ \ Don\[cq]t read from stdin. .PP \f[B]-T\f[R]: \ \ \ \ Disable pty allocation. .PP \f[B]-t\f[R]: \ \ \ \ Allocate a pty if on a tty (-tt: force pty allocation). .PP \f[B]-x\f[R] \ \ \ \ Disable remote exit codes and stdout/stderr separation. .PP emu \f[B]COMMAND\f[R] \ \ \ \ Run emulator console \f[B]COMMAND\f[R] .SH APP INSTALLATION .PP (see also \f[C]adb shell cmd package help\f[R]): .PP install [\f[B]-lrtsdg\f[R]] [\f[B]\[en]instant\f[R]] \f[B]PACKAGE\f[R] \ \ \ \ Push a single package to the device and install it .PP install-multiple [\f[B]-lrtsdpg\f[R]] [\f[B]\[en]instant\f[R]] \f[B]PACKAGE\f[R]\&... \ \ \ \ Push multiple APKs to the device for a single package and install them .PP install-multi-package [\f[B]-lrtsdpg\f[R]] [\f[B]\[en]instant\f[R]] \f[B]PACKAGE\f[R]\&... \ \ \ \ Push one or more packages to the device and install them atomically .PP \f[B]-r\f[R]: \ \ \ \ Replace existing application. .PP \f[B]-t\f[R] \ \ \ \ Allow test packages. .PP \f[B]-d\f[R] \ \ \ \ Allow version code downgrade (debuggable packages only). .PP \f[B]-p\f[R] \ \ \ \ Partial application install (install-multiple only). .PP \f[B]-g\f[R] \ \ \ \ Grant all runtime permissions. .PP \f[B]--abi\f[R] \f[B]ABI\f[R] \ \ \ \ Override platform\[cq]s default ABI. .PP \f[B]--instant\f[R] \ \ \ \ Cause the app to be installed as an ephemeral install app. .PP \f[B]--no-streaming\f[R] \ \ \ \ Always push APK to device and invoke Package Manager as separate steps. .PP \f[B]--streaming\f[R] \ \ \ \ Force streaming APK directly into Package Manager. .PP \f[B]--fastdeploy\f[R] \ \ \ \ Use fast deploy. .PP \f[B]-no-fastdeploy\f[R] \ \ \ \ Prevent use of fast deploy. .PP \f[B]-force-agent\f[R] \ \ \ \ Force update of deployment agent when using fast deploy. .PP \f[B]-date-check-agent\f[R] \ \ \ \ Update deployment agent when local version is newer and using fast deploy. .PP \f[B]--version-check-agent\f[R] \ \ \ \ Update deployment agent when local version has different version code and using fast deploy. .PP \f[B]--local-agent\f[R] \ \ \ \ Locate agent files from local source build (instead of SDK location). See also \f[C]adb shell pm help\f[R] for more options. .PP uninstall [\f[B]-k\f[R]] \f[B]APPLICATION_ID\f[R] \ \ \ \ Remove this \f[B]APPLICATION_ID\f[R] from the device. .PP \f[B]-k\f[R] \ \ \ \ Keep the data and cache directories. .SH DEBUGGING: .PP bugreport [\f[B]PATH\f[R]] \ \ \ \ Write bugreport to given PATH [default=bugreport.zip]; if \f[B]PATH\f[R] is a directory, the bug report is saved in that directory. devices that don\[cq]t support zipped bug reports output to stdout. .PP jdwp \ \ \ \ List pids of processes hosting a JDWP transport. .PP logcat \ \ \ \ Show device log (logcat \[en]help for more). .PP server-status Display server configuration (USB backend, mDNS backend, log location, binary path. See adb_host.proto (AdbServerStatus) for details. .SH SECURITY: .PP disable-verity \ \ \ \ Disable dm-verity checking on userdebug builds. .PP enable-verity \ \ \ \ Re-enable dm-verity checking on userdebug builds. .PP keygen \f[B]FILE\f[R] \ \ \ \ Generate adb public/private key; private key stored in \f[B]FILE\f[R]. .SH SCRIPTING: .PP wait-for [-\f[B]TRANSPORT\f[R]] -\f[B]STATE\f[R]\&... \ \ \ \ Wait for device to be in a given state. .PP \ \ \ \ \f[B]STATE\f[R]: device, recovery, rescue, sideload, bootloader, or disconnect. \ \ \ \ \f[B]TRANSPORT\f[R]: \f[B]usb\f[R], \f[B]local\f[R], or \f[B]any\f[R] [default=\f[B]any\f[R]]. .PP get-state \ \ \ \ Print offline | bootloader | device. .PP get-serialno \ \ \ \ Print \f[B]SERIAL_NUMBER\f[R]. .PP get-devpath \ \ \ \ Print \f[B]DEVICE_PATH\f[R]. .PP remount [\f[B]-R\f[R]] \ \ \ \ Remount partitions read-write. .PP \f[B]-R\f[R] \ \ \ \ Automatically reboot the device. .PP reboot [\f[B]bootloader\f[R]|\f[B]recovery\f[R]|\f[B]sideload\f[R]|\f[B]sideload-auto-reboot\f[R]] \ \ \ \ Reboot the device; defaults to booting system image but supports \f[B]bootloader\f[R] and \f[B]recovery\f[R] too. .PP \f[B]sideload\f[R] \ \ \ \ Reboots into recovery and automatically starts sideload mode. .PP \f[B]sideload-auto-reboot\f[R] \ \ \ \ Same as \f[B]sideload\f[R] but reboots after sideloading. .PP sideload \f[B]OTAPACKAGE\f[R] \ \ \ \ Sideload the given full OTA package \f[B]OTAPACKAGE\f[R]. .PP root \ \ \ \ Restart adbd with root permissions. .PP unroot \ \ \ \ Restart adbd without root permissions. .PP usb \ \ \ \ Restart adbd listening on USB. .PP tcpip \f[B]PORT\f[R] \ \ \ \ Restart adbd listening on TCP on \f[B]PORT\f[R]. .SH INTERNAL DEBUGGING: .PP start-server \ \ \ \ Ensure that there is a server running. .PP kill-server \ \ \ \ Kill the server if it is running. .PP reconnect \ \ \ \ Close connection from host side to force reconnect. .PP reconnect device \ \ \ \ Close connection from device side to force reconnect. .PP reconnect offline \ \ \ \ Reset offline/unauthorized devices to force reconnect. .SH USB: .PP Only valid when running with libusb backend. .PP attach \f[B]SERIAL\f[R] \ \ \ \ Attach a detached USB device identified by its \f[B]SERIAL\f[R] number. .PP detach \f[B]SERIAL\f[R] \ \ \ \ Detach from a USB device identified by its \f[B]SERIAL\f[R] to allow use by other processes. .SH Features: .PP host-features .PD 0 .P .PD \ \ \ \ list features supported by adb server. .PP features .PD 0 .P .PD \ \ \ \ list features supported by both adb server and device. .SH ENVIRONMENT VARIABLES .PP $ADB_TRACE \ \ \ \ Comma (or space) separated list of debug info to log: all,adb,sockets,packets,rwx,usb,sync,sysdeps,transport,jdwp,services,auth,fdevent,shell,incremental, mdns. .PP $ADB_VENDOR_KEYS \ \ \ \ Colon-separated list of keys (files or directories). .PP $ANDROID_SERIAL \ \ \ \ Serial number to connect to (see -s). .PP $ANDROID_LOG_TAGS \ \ \ \ Tags to be used by logcat (see logcat \[en]help). .PP $ADB_LOCAL_TRANSPORT_MAX_PORT \ \ \ \ Max emulator scan port (default 5585, 16 emulators). .PP $ADB_MDNS_AUTO_CONNECT \ \ \ \ Comma-separated list of mdns services to allow auto-connect (default adb-tls-connect). .PP $ADB_MDNS_OPENSCREEN \ \ \ \ The default mDNS-SD backend is Bonjour (mdnsResponder). For machines where Bonjour is not installed, adb can spawn its own, embedded, mDNS-SD back end, openscreen. If set to \[lq]1\[rq], this env variable forces mDNS backend to openscreen. .PP $ADB_LIBUSB \ \ \ \ ADB has its own USB backend implementation but can also employ libusb. use \f[C]adb devices -l\f[R] (\f[C]usb:\f[R] prefix is omitted for libusb) or \f[C]adb host-features\f[R] (look for \f[C]libusb\f[R] in the output list) to identify which is in use. To override the default for your OS, set ADB_LIBUSB to \[lq]1\[rq] to enable libusb, or \[lq]0\[rq] to enable the ADB backend implementation. .SH BUGS .PP See Issue Tracker: here (https://issuetracker.google.com/issues/new?component=192795&template=1310483). .SH AUTHORS .PP See OWNERS file in ADB AOSP repo.