Connect to a device over Wi-Fi
android_connect_wifiEnable wireless adb on a USB-connected Android device, or reconnect to a known address to continue untethered debugging.
Instructions
Switch a USB-connected device to wireless adb, or reconnect to one that was paired before.
Wireless adb is what makes it practical to keep iterating on a phone that is not tethered to the machine. The device and the host must be on the same network.
Two modes:
No 'host' given — requires a USB device. Reads the device's Wi-Fi address, runs 'adb tcpip', then connects. After this succeeds the USB cable can be unplugged.
'host' given — reconnects directly to a known address, no USB needed.
Args:
host (string, optional): device IP, with or without port, e.g. "192.168.0.12" or "192.168.0.12:5555"
port (number): TCP port to use (default: 5555)
serial (string, optional): USB serial to promote to wireless, when several devices are attached
Returns: { "serial": string, "host": string, "port": number, "alreadyConnected": boolean }
Examples:
Use when: you want to unplug the cable and keep building to the device
Use when: the wireless connection dropped after the phone slept and you need it back
Don't use when: you only need to know what is connected (use android_list_devices)
Error Handling:
"no usable IPv4 address" means the device is not on Wi-Fi; connect it to the same network as this machine
A device that has rebooted loses TCP/IP mode entirely and must be re-promoted over USB
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | Known device address to reconnect to. Omit to promote a USB device. | |
| port | No | TCP port for the adb connection. | |
| serial | No | Device serial from android_list_devices. Optional when exactly one device is connected; required when several are. |