adb-connect
Connect to Android device over network
TLDR
Pair with an Android device (address and pairing code can be found in developer options)
Connect to an Android device (port will be different from pairing)
Disconnect a device
SYNOPSIS
adb-connect [host[:port]] [-a] [-p PORT] [-r] [-s SERIAL] [-h]
PARAMETERS
-a, --auto
Automatically discover device IP on local network using mDNS or scanning
-p PORT, --port PORT
TCP port for ADB connection (default: 5555)
-r, --reconnect
Reconnect to device already in TCP/IP mode
-s SERIAL, --serial SERIAL
Target specific device by serial number
-h, --help
Display usage help and exit
DESCRIPTION
adb-connect is a bash script utility that simplifies establishing an Android Debug Bridge (ADB) connection over TCP/IP (WiFi) to Android devices on the same local network, eliminating the need for a USB cable after initial setup.
It automates key steps: discovering the device's IP address via mDNS (using Avahi), ARP scanning, or manual input; restarting ADB in TCP/IP mode if needed; and issuing the adb connect command. Ideal for developers debugging apps, taking screenshots, or running shell commands wirelessly.
Usage typically starts with an initial USB connection to enable wireless ADB (via adb tcpip 5555), after which adb-connect handles ongoing WiFi links. Supports multiple devices, reconnection, and custom ports. Requires adb installed and devices on the same LAN with firewall allowing port 5555.
Common in Linux distros via AUR or GitHub, enhancing productivity for Android development workflows.
CAVEATS
Requires initial USB setup for TCP/IP mode on non-rooted devices; same LAN needed; firewall must allow port 5555; may fail on busy networks or with multiple devices.
EXAMPLE USAGE
adb-connect
adb-connect 192.168.1.100:5555
adb-connect -a -r
PREREQUISITES
Install ADB: sudo apt install adb or equivalent; enable Developer Options & Wireless Debugging on device.
HISTORY
Community-developed bash script emerging around 2015 on GitHub (e.g., repos by fhorinek, SparrowOWL); popularized in Arch Linux AUR for wireless Android debugging convenience.
SEE ALSO
adb(1), avahi-browse(1), arp-scan(1)


