.\" Automatically generated by Pandoc 2.17.1.1 .\" .\" Define V font for inline verbatim, using C font in formats .\" that render this, and otherwise B font. .ie "\f[CB]x\f[]"x" \{\ . ftr V B . ftr VI BI . ftr VB B . ftr VBI BI .\} .el \{\ . ftr V CR . ftr VI CI . ftr VB CB . ftr VBI CBI .\} .TH "ADB" "1" "" "android-platform-system-core" "adb Manuals" .hy .SH NAME .PP adb - Android Debug Bridge .SH SYNOPSIS .PP \f[B]adb\f[R] [-d|-e|-s \f[I]serialNumber\f[R]] \f[I]command\f[R] .SH DESCRIPTION .PP WARNING: This manual might be outdated, please refer to the official documentation. .PP Android Debug Bridge (\f[B]adb\f[R]) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. It is a client-server program that includes three components: .IP \[bu] 2 \f[B]A client\f[R], which sends commands. The client runs on your development machine. You can invoke a client from a shell by issuing an \f[B]adb\f[R] command. Other Android tools such as DDMS also create \f[B]adb\f[R] clients. .IP \[bu] 2 \f[B]A daemon\f[R], which runs commands on a device. The daemon runs as a background process on each emulator or device instance. .IP \[bu] 2 \f[B]A server\f[R], which manages communication between the client and the daemon. The server runs as a background process on your development machine. .PP If there\[aq]s only one emulator running or only one device connected, the \f[B]adb\f[R] command is sent to that device by default. If multiple emulators are running and/or multiple devices are attached, you need to use the \f[B]-d\f[R], \f[B]-e\f[R], or \f[B]-s\f[R] option to specify the target device to which the command should be directed. .SH OPTIONS .TP -a Directs \f[B]adb\f[R] to listen on all interfaces for a connection. .TP -d Directs command to the only connected USB device. Returns an error if more than one USB device is present. .TP -e Directs command to the only running emulator. Returns an error if more than one emulator is running. .TP -s \f[I]specific device\f[R] Directs command to the device or emulator with the given serial number or qualifier. Overrides \f[B]ANDROID_SERIAL\f[R] environment variable. .TP -p \f[I]product name or path\f[R] Simple product name like \f[B]sooner\f[R], or a relative/absolute path to a product out directory like \f[B]out/target/product/sooner\f[R]. If \f[B]-p\f[R] is not specified, the \f[B]ANDROID_PRODUCT_OUT\f[R] environment variable is used, which must be an absolute path. .TP -H Name of adb server host (default: \f[B]localhost\f[R]) .TP -P Port of adb server (default: \f[B]5037\f[R]) .SH COMMANDS .TP adb devices [-l] List all connected devices. \f[B]-l\f[R] will also list device qualifiers. .TP adb connect \f[I]host\f[R][:\f[I]port\f[R]] Connect to a device via TCP/IP. Port \f[B]5555\f[R] is used by default if no port number is specified. .TP adb disconnect [\f[I]host\f[R][:\f[I]port\f[R]]] Disconnect from a TCP/IP device. Port \f[B]5555\f[R] is used by default if no port number is specified. Using this command with no additional arguments will disconnect from all connected TCP/IP devices. .SS Device commands .TP adb push \f[I]local\f[R]... \f[I]remote\f[R] Copy file/dir to device. .TP adb pull [-a] \f[I]remote\f[R] [\f[I]local\f[R]] Copy file/dir from device. \f[B]-a\f[R] means copy timestamp and mode. .TP adb sync [-l] [\f[I]directory\f[R]] Copy host->device only if changed. \f[B]-l\f[R] means list but don\[aq]t copy. .PP If \f[I]directory\f[R] is not specified, \f[B]/system\f[R], \f[B]/vendor\f[R] (if present), \f[B]/oem\f[R] (if present) and \f[B]/data\f[R] partitions will be updated. .PP If it is \f[B]system\f[R], \f[B]vendor\f[R], \f[B]oem\f[R] or \f[B]data\f[R], only the corresponding partition is updated. .TP adb shell [-e \f[I]escape\f[R]] [-n] [-T|-t] [-x] [\f[I]command\f[R]] Run remote shell command (interactive shell if no command given) .IP \[bu] 2 -e: Choose escape character, or \f[B]none\f[R]; default \f[B]\[ti]\f[R] .IP \[bu] 2 -n: Don\[aq]t read from stdin .IP \[bu] 2 -T: Disable PTY allocation .IP \[bu] 2 -t: Force PTY allocation .IP \[bu] 2 -x: Disable remote exit codes and stdout/stderr separation .TP adb emu \f[I]command\f[R] Run emulator console command .TP adb logcat [\f[I]filter-spec\f[R]] View device log. .TP adb forward --list List all forward socket connections. The format is a list of lines with the following format: \f[B]\f[BI]serial\f[B] \[dq] \[dq] \f[BI]local\f[B] \[dq] \[dq] \f[BI]remote\f[B] \[dq]\[dq]\f[R] .TP adb forward \f[I]local\f[R] \f[I]remote\f[R] Forward socket connections. .PP Forward specs are one of: .IP \[bu] 2 tcp:\f[I]port\f[R] .IP \[bu] 2 localabstract:\f[I]unix domain socket name\f[R] .IP \[bu] 2 localreserved:\f[I]unix domain socket name\f[R] .IP \[bu] 2 localfilesystem:\f[I]unix domain socket name\f[R] .IP \[bu] 2 dev:\f[I]character device name\f[R] .IP \[bu] 2 jdwp:\f[I]process pid\f[R] (remote only) .TP adb forward --no-rebind \f[I]local\f[R] \f[I]remote\f[R] Same as \[dq]adb forward \f[I]local\f[R] \f[I]remote\f[R]\[dq] but fails if \f[I]local\f[R] is already forwarded .TP adb forward --remove \f[I]local\f[R] Remove a specific forward socket connection. .TP adb forward --remove-all Remove all forward socket connections. .TP adb reverse --list List all reverse socket connections from device. .TP adb reverse \f[I]remote\f[R] \f[I]local\f[R] Reverse socket connections. .PP Reverse specs are one of: .IP \[bu] 2 tcp:\f[I]port\f[R] .IP \[bu] 2 localabstract:\f[I]unix domain socket name\f[R] .IP \[bu] 2 localreserved:\f[I]unix domain socket name\f[R] .IP \[bu] 2 localfilesystem:\f[I]unix domain socket name\f[R] .TP adb reverse --no-rebind \f[I]remote\f[R] \f[I]local\f[R] Same as \[aq]adb reverse \f[I]remote\f[R] \f[I]local\f[R]\[aq] but fails if \f[I]remote\f[R] is already reversed. .TP adb reverse --remove \f[I]remote\f[R] Remove a specific reversed socket connection. .TP adb reverse --remove-all Remove all reversed socket connections from device. .TP adb jdwp List PIDs of processes hosting a JDWP transport. .TP adb install [-lrtsdg] \f[I]file\f[R] Push this package file to the device and install it. .IP \[bu] 2 \f[B]-l\f[R]: Forward lock application. .IP \[bu] 2 \f[B]-r\f[R]: Replace existing application. .IP \[bu] 2 \f[B]-t\f[R]: Allow test packages. .IP \[bu] 2 \f[B]-s\f[R]: Install application on sdcard. .IP \[bu] 2 \f[B]-d\f[R]: Allow version code downgrade (debuggable packages only). .IP \[bu] 2 \f[B]-g\f[R]: Grant all runtime permissions. .TP adb install-multiple [-lrtsdpg] \f[I]file...\f[R] Push this package file to the device and install it. .IP \[bu] 2 \f[B]-l\f[R]: Forward lock application. .IP \[bu] 2 \f[B]-r\f[R]: Replace existing application. .IP \[bu] 2 \f[B]-t\f[R]: Allow test packages. .IP \[bu] 2 \f[B]-s\f[R]: Install application on sdcard. .IP \[bu] 2 \f[B]-d\f[R]: Allow version code downgrade (debuggable packages only). .IP \[bu] 2 \f[B]-p\f[R]: Partial application install. .IP \[bu] 2 \f[B]-g\f[R]: Grant all runtime permissions. .TP adb uninstall [-k] \f[I]package\f[R] Remove this app package from the device. \f[B]-k\f[R] means keep the data and cache directories. .TP adb bugreport [\f[I]zipfile\f[R]] Return all information from the device that should be included in a bug report. .TP adb backup [-f \f[I]file\f[R]] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all] [-system|-nosystem] [\f[I]packages...\f[R]] Write an archive of the device\[aq]s data to \f[I]file\f[R]. If no \f[B]-f\f[R] option is supplied then the data is written to \f[B]backup.ab\f[R] in the current directory. .PP \f[B]-apk\f[R] | \f[B]-noapk\f[R] enable/disable backup of the .apks themselves in the archive; the default is noapk. .PP \f[B]-obb\f[R] | \f[B]-noobb\f[R] enable/disable backup of any installed apk expansion (aka .obb) files associated with each application; the default is noobb. .PP \f[B]-shared\f[R] | \f[B]-noshared\f[R] enable/disable backup of the device\[aq]s shared storage / SD card contents; the default is noshared. .PP \f[B]-all\f[R] means to back up all installed applications. .PP \f[B]-system\f[R] | \f[B]-nosystem\f[R] toggles whether \f[B]-all\f[R] automatically includes system applications; the default is to include system apps. .PP \f[I]packages...\f[R] is the list of applications to be backed up. If the \f[B]-all\f[R] or \f[B]-shared\f[R] flags are passed, then the package list is optional. Applications explicitly given on the command line will be included even if \f[B]-nosystem\f[R] would ordinarily cause them to be omitted. .TP adb restore \f[I]file\f[R] Restore device contents from the \f[I]file\f[R] backup archive. .TP adb disable-verity Disable dm-verity checking on USERDEBUG builds. .TP adb enable-verity Re-enable dm-verity checking on USERDEBUG builds. .TP adb keygen \f[I]file\f[R] Generate adb public/private key. The private key is stored in \f[I]file\f[R], and the public key is stored in \f[I]file\f[R].pub. Any existing files are overwritten. .TP adb help Show help message. .TP adb version Show version number. .SS Scripting .TP adb wait-for-[-\f[I]transport\f[R]]-\f[I]state\f[R] Wait for device to be in the given state: \f[B]device\f[R], \f[B]recovery\f[R], \f[B]sideload\f[R], or \f[B]bootloader\f[R]. \f[I]transport\f[R] is: \f[B]usb\f[R], \f[B]local\f[R] or \f[B]any\f[R] (default = \f[B]any\f[R]) .TP adb start-server Ensure that there is a server running. .TP adb kill-server Kill the server if it is running. .TP adb get-state Prints: \f[B]offline\f[R] | \f[B]bootloader\f[R] | \f[B]device\f[R] .TP adb get-serialno Prints: \f[I]serial-number\f[R]. .TP adb get-devpath Prints: \f[I]device-path\f[R]. .TP adb remount Remounts the \f[B]/system\f[R], \f[B]/vendor\f[R] (if present) and \f[B]/oem\f[R] (if present) partitions on the device read-write. .TP adb reboot [bootloader|recovery] Reboots the device, optionally into the bootloader or recovery program. .TP adb reboot sideload Reboots the device into the sideload mode in recovery program (adb root required). .TP adb reboot sideload-auto-reboot Reboots into the sideload mode, then reboots automatically after the sideload regardless of the result. .TP adb sideload \f[I]file\f[R] Sideloads the given package. .TP adb root Restarts the adbd daemon with root permissions. .TP adb unroot Restarts the adbd daemon without root permissions. .TP adb usb Restarts the adbd daemon listening on USB. .TP adb tcpip \f[I]port\f[R] Restarts the adbd daemon listening on TCP on the specified port. .SS Networking .TP adb ppp \f[I]tty\f[R] [\f[I]parameters\f[R]] Run PPP over USB. .PP \f[I]parameters\f[R]: E.g. \f[B]defaultroute debug dump local notty usepeerdns\f[R] .PP Note: you should not automatically start a PPP connection. \f[I]tty\f[R] refers to the tty for PPP stream. E.g. \f[B]dev:/dev/omap_csmi_tty1\f[R] .SH Internal Debugging .TP adb reconnect Kick current connection from host side and make it reconnect. .TP adb reconnect device Kick current connection from device side and make it reconnect. .SH ENVIRONMENT VARIABLES .TP ADB_TRACE Print debug information. A comma separated list of the following values \f[B]1\f[R] or \f[B]all\f[R], \f[B]adb\f[R], \f[B]sockets\f[R], \f[B]packets\f[R], \f[B]rwx\f[R], \f[B]usb\f[R], \f[B]sync\f[R], \f[B]sysdeps\f[R], \f[B]transport\f[R], \f[B]jdwp\f[R] .TP ANDROID_SERIAL The serial number to connect to. \f[B]-s\f[R] takes priority over this if given. .TP ANDROID_LOG_TAGS When used with the logcat option, only these debug tags are printed. .SH SEE ALSO .PP https://developer.android.com/tools/help/adb.html .SH AUTHORS The Android Open Source Project.