Global Options: Android Debug Bridge ADB Command
Global Options: Android Debug Bridge ADB Command
Global Options: Android Debug Bridge ADB Command
ADB Command
You can issue adb commands from a command line on your development machine
or from a script.
adb [-d | -e | -s serial_number] command
If there\'s only one emulator running or only one device connected, the adb
command is sent to that device by default. If multiple emulators are running and/or
multiple devices are attached, you need to use the -d, -e, or -s option to specify the
target device to which the command should be directed.
The table below lists all of the supported adb commands and explains their meaning
and usage.
Global options
Listen on all network interfaces instead of only on localhost .
adb -a
Direct an adb command to the only attached USB device. Returns an error when
more than one USB device is attached.
adb -d
Direct an adb command to the only running emulator. Returns an error when more
than one emulator is running.
adb -e
Direct an adb command to a specific device, referred to by its adb-assigned serial
number (such as emulator-5556). Overrides the serial number value stored in
the $ANDROID_SERIAL environment variable.
adb -s serial_number
The name of the adb server host. The default value is localhost .
adb -H server
The adb server port number. The default value is 5037 .
adb -P port
Listen on the provided adb server socket. The default value is tcp:localhost:5037 .
adb -L socket
General commands
Print a list of all devices. Use the -l option to include the device descriptions.
adb devices [-l]
Networking commands
Connect to a device over TCP/IP. If you do not specify a port, then the default
port, 5555 , is used.
adb connect host[:port]
Disconnect from the specified TCP/IP device running on the specified port. If you do
not specify a host or a port, then all devices are disconnected from all TCP/IP ports.
If you specify a host, but not a port, the default port, 5555 , is used.
adb disconnect [host | host:port]
Forward socket connections from the specified local port to the specified remote port
on the device. You can specify both local and remote ports in the following ways:
tcp:port . To choose any open port, make the local value tcp:0 .
localabstract:unix_domain_socket_name .
localreserved:unix_domain_socket_name .
localfilesystem:unix_domain_socket_name .
dev:character_device_name .
jdwp:pid .
adb forward [--no-rebind] local remote