ADB(1)

๐ŸŽ€ ADB(1) โ€” your bestie's guide to the Android Debug Bridge ๐Ÿ’–

๐Ÿฆ‹ VERSION ๐Ÿฆ‹

1.0.41 โœจ

๐ŸŒธ NAME ๐ŸŒธ

adb โ€” CLI Client for ADB (Android Debug Bridge) Server ๐Ÿ’…

๐Ÿงš SYNOPSIS ๐Ÿงš

adb [GLOBAL_OPTIONS] command [COMMAND_OPTIONS]

๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

okay so adb is the command-line client that talks to the ADB Server through its smart socket interface. You send it requests, it gets the responses back, and it also manages the whole lifecycle of the adb server. iconic behavior honestly ๐Ÿ”ฅ

Everything gets done through commands ๐Ÿ’… Some commands are handled directly by the server, and others get forwarded over to the adbd(ADB daemon) running on the device ๐Ÿ“ฑโœจ

๐ŸŒˆ GLOBAL OPTIONS ๐ŸŒˆ

  • -a โ€” listen on all network interfaces, not just localhost ๐ŸŒ
  • -d โ€” use a USB device (it'll error if multiple devices are connected, so be careful bestie ๐Ÿ˜ญ)
  • -e โ€” use a TCP/IP device (also errors if multiple TCP/IP devices are available)
  • -s SERIAL โ€” use the device with the given SERIAL. This one overrides $ANDROID_SERIAL ๐Ÿซถ
  • -t ID โ€” use the device with the given transport ID
  • -H โ€” name of the adb server host [default=localhost]
  • -P PORT โ€” smart socket PORT of the adb server [default=5037]
  • -L SOCKET โ€” listen on the given socket for the adb server [default=tcp:localhost:5037]
  • --one-device SERIAL|USB โ€” the server will only connect to one USB device, picked by a SERIAL number or a USB device address. This only works with start-server or server nodaemon ๐Ÿฆ‹
  • --exit-on-write-error โ€” exit if stdout is closed ๐Ÿ™ˆ

๐Ÿ“ GENERAL COMMANDS ๐Ÿ“

  • devices [-l] โ€” list connected devices ๐Ÿ“‹
    • -l โ€” use long output
  • track-devices [-l][โ€“proto-text][โ€“proto-binary] โ€” same vibe as the `device' command, but it never returns. Instead it sends updates whenever the list of devices changes ๐Ÿ‘€
    • -l โ€” use legacy long output
    • -proto-text โ€” use protobuf output
    • -proto-binary โ€” use binary protobuf output
  • help โ€” show the help message ๐Ÿ†˜
  • version โ€” show the version number ๐Ÿ”ข

๐ŸŒ NETWORKING ๐ŸŒ

  • connect HOST[:PORT] โ€” connect to a device over TCP/IP [default PORT=5555] ๐Ÿ”Œ
  • disconnect [HOST[:PORT]] โ€” disconnect from the given TCP/IP device [default PORT=5555], or from all of them if you don't specify one ๐Ÿ™…โ€โ™€๏ธ
  • pair HOST[:PORT] [PAIRING_CODE] โ€” pair with a device for secure TCP/IP communication ๐Ÿ”
  • forward --list | [โ€“no-rebind] LOCAL_REMOTE | --remove LOCAL | --remove-all
    • --list โ€” list all forward socket connections
    • [โ€“no-rebind] LOCAL_REMOTE โ€” forward a socket connection using one of these formats:
      • tcp:PORT (local can be tcp:0 to grab any open port)
      • localreserved:UNIX_DOMAIN_SOCKET_NAME
      • localfilesystem:UNIX_DOMAIN_SOCKET_NAME
      • jdwp:PROCESS PID (remote only)
      • vsock:CID:PORT (remote only)
      • acceptfd:FD (listen only)
      • dev:DEVICE_NAME
      • dev-raw:DEVICE_NAME (opens the device in raw mode)
    • --remove LOCAL โ€” remove one specific forward socket connection
    • --remove-all โ€” remove all forward socket connections
  • reverse --list | [--no-rebind] REMOTE LOCAL | --remove REMOTE | --remove-all
    • --list โ€” list all reverse socket connections from the device
    • [--no-rebind] REMOTE LOCAL โ€” reverse a socket connection using one of these formats:
      • tcp:PORT (REMOTE can be tcp:0 to pick any open port)
      • localabstract:UNIX_DOMAIN_SOCKET_NAME
      • localreserved:UNIX_DOMAIN_SOCKET_NAME
      • localfilesystem:UNIX_DOMAIN_SOCKET_NAME
    • --remove REMOTE โ€” remove one specific reverse socket connection
    • --remove-all โ€” remove all reverse socket connections from the device
  • mdns check | services โ€” mDNS subcommands ๐Ÿ›ฐ๏ธ
    • check โ€” check if mdns discovery is available
    • services โ€” list all discovered services
  • track-services โ€” stream discovered services as they show up. Supports the flags โ€œโ€“proto-textโ€ and โ€œโ€“proto-binaryโ€ โœจ
  • list-known-hosts โ€” show ADB Wifi paired devices. Supports the flags โ€œโ€“proto-textโ€ and โ€œโ€“proto-binaryโ€ ๐Ÿ’–

๐ŸŽ€ FILE TRANSFER ๐ŸŽ€

  • push [โ€“sync] [-z ALGORITHM] [-Z] LOCAL... REMOTE โ€” copy local files and directories onto the device ๐Ÿ“ค
    • โ€“sync โ€” only push files that are newer on the host than on the device
    • -n โ€” dry run! pushes files to the device without storing them to the filesystem ๐Ÿงช
    • -z โ€” enable compression with a specified algorithm (any/none/brotli/lz4/zstd)
    • -Z โ€” disable compression
  • pull [-a] [-z ALGORITHM] [-Z] REMOTE... LOCAL โ€” copy files and directories from the device ๐Ÿ“ฅ
    • -a โ€” preserve file timestamp and mode ๐Ÿ•ฐ๏ธ
    • -z โ€” enable compression with a specified algorithm (any/none/brotli/lz4/zstd)
    • -Z โ€” disable compression
  • sync [-l] [-z ALGORITHM] [-Z] [all|data|odm|oem|product|system|system_ext|vendor] โ€” sync a local build from $ANDROID_PRODUCT_OUT to the device (default all) ๐Ÿ—๏ธ
    • -n โ€” dry run. Pushes files to the device without storing them to the filesystem
    • -l โ€” list the files that would be copied, but don't actually copy them
    • -z โ€” enable compression with a specified algorithm (any/none/brotli/lz4/zstd)
    • -Z โ€” disable compression

๐Ÿš SHELL ๐Ÿš

  • shell [-e ESCAPE] [-n] [-Tt] [-x] [COMMAND...] โ€” run a remote shell command. If you don't give a command, you get an interactive shell ๐Ÿ’ป
    • -e โ€” choose the escape character, or none. Default is ~
    • -n โ€” don't read from stdin
    • -T โ€” disable pty allocation
    • -t โ€” allocate a pty if you're on a tty (-tt: force pty allocation)
    • -x โ€” disable remote exit codes and stdout/stderr separation
  • emu COMMAND โ€” run emulator console COMMAND ๐ŸŽฎ

โœจ AUTHORS โœจ

okay bestie, the credits are short and sweet ๐Ÿซถ for who wrote ADB, check the OWNERS file in the ADB AOSP repo ๐Ÿ’– that's where the whole crew is listed ๐Ÿ‘‘


The page wraps up with a lonely () as its footer ๐Ÿ™ˆ There's no source, version, or date on it, so there's nothing else to hunt down. Stay iconic and keep those devices connected ๐Ÿฆ‹๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from