LinuxCommandLibrary

adb-disconnect

Disconnect an Android device over network/USB

TLDR

View documentation for adb disconnect

$ tldr adb connect
copy

SYNOPSIS

adb-disconnect [host[:port]]

PARAMETERS

host[:port]
    IP address and optional port (default 5555) of the target wireless device. Omitting disconnects all TCP/IP devices.

DESCRIPTION

The adb-disconnect command severs TCP/IP (wireless) connections to Android devices managed by the Android Debug Bridge (ADB). ADB is a core client-server program in the Android SDK Platform-Tools, enabling developers to communicate with physical or emulator-based Android devices for debugging, file transfer, and shell access.

Wireless ADB eliminates the need for USB cables by connecting over a network, typically after running adb tcpip on the device via USB first. adb-disconnect is particularly useful for managing multiple devices, cleaning up stale connections, or switching between wired and wireless modes without rebooting the ADB server.

Without arguments, it disconnects all TCP/IP devices. Specifying a host (IP address) and optional port targets a specific device. This command interacts with the ADB daemon (adbd) running on both host and device. It requires root or developer options enabled on the Android device and the devices to be on the same network subnet.

Common use cases include remote debugging sessions, CI/CD pipelines, and automated testing environments where dynamic device connections are needed.

CAVEATS

Only affects TCP/IP devices, not USB-connected ones. Requires ADB server running (adb start-server). Device must have wireless debugging enabled. Firewall or network issues may prevent reconnection.

EXAMPLES

adb-disconnect
Disconnects all wireless devices.

adb-disconnect 192.168.1.42:5555
Disconnects specific device.

HISTORY

Part of Android SDK Platform-Tools since wireless ADB support in Android 4.2.2 (API 17, 2012). Standalone adb-disconnect scripts/wrappers emerged in Linux distros (e.g., Arch, Fedora AUR) around 2015 for convenience, often aliasing adb disconnect. Enhanced in Android 11+ for pairable wireless debugging without initial USB.

SEE ALSO

Use adb connect host:port to reconnect; adb devices -l to list connections.

SEE ALSO

adb(1), fastboot(8)

Copied to clipboard