How to enable Wi-Fi debugging in Android Studio
Detailed steps for connecting a device to Android Studio over Wi-Fi instead of a cable. There are two ways below: the classic one through adb tcpip, which works on any Android version, and the built-in wireless debugging of Android 11 and newer, which needs no cable at all.
Through adb tcpip
- Open the router settings and give the device a static IP address — usually in the DHCP server section for the LAN. The example here uses
192.168.1.128. The "isolate access point clients" option must be off, and the device and the computer must be on the same network. - Reconnect to the access point or restart the router.
- Open the developer options on the device: tap the build number in "About phone" several times.
- In the developer options, turn on USB debugging.
- Connect the device by cable to the computer running Android Studio and allow debugging access on the device. The device should then appear in the device list.
- Open a terminal and check the device's IP address:
adb shell ip -f inet addr show wlan0The output contains a line like inet 192.168.1.128/24 brd 192.168.1.255 scope global wlan0.
If adb is not found, give its full path: ~/Library/Android/sdk/platform-tools/adb on macOS, C:\Users\<user>\AppData\Local\Android\Sdk\platform-tools\adb on Windows.
- Switch adb on the device to network mode:
adb tcpip 5555You should see restarting in TCP mode port: 5555.
- Connect over the network:
adb connect 192.168.1.128:5555On success you get connected to 192.168.1.128:5555. Now the cable can be unplugged. To check that the device is reachable, run adb devices: the list will show 192.168.1.128:5555 device. With no devices the list is empty, and commands such as adb shell answer adb: no devices/emulators found.
To disconnect and put adb back into USB mode:
adb disconnect 192.168.1.128:5555adb usbA reboot of the device resets TCP mode, and steps 5–8 have to be repeated.
Android 11+ wireless debugging
Since Android 11, Wi-Fi debugging is built into the system, and no cable is needed even for the first connection.
- In the developer options, turn on Wireless debugging.
- The easiest way is in Android Studio: in the device list choose Pair Devices Using Wi-Fi and scan the QR code from the device via Pair device with QR code.
- Or from a terminal: on the device open Pair device with pairing code, which shows an address with a port and a six-digit code, and run
adb pair 192.168.1.128:<pairing port>adb connect 192.168.1.128:<connection port>adb pair prompts for the six-digit code. The connection port is a different one: it is shown on the main wireless debugging screen, next to the IP address.
There is also the third-party ADB Wi-Fi plugin: connect the device by USB and press Connect in its panel, after which the cable can go. These days the built-in pairing is usually enough.