Yep, this is doable too. But it requires an initial connection over USB.
- Connect the device over USB, with USB debugging enabled
- Open a terminal and check the device is connected:
> adb devices
- Ask the device to listen for adb connections on a particular port:
> adb tcpip 12345
or
> adb -s DEVICE_ID tcpip 12345
- Once the adb has restarted, disconnect the device from USB.
- Check the device IP address, and connect to it over wifi:
> adb connect 192.168.0.2:12345
- Ready to develop.
- Once done with dev, return the device to USB mode to not let the tcp port open as as security risk:
> adb usb
It’s a bit more work than the simple settings toggle on Android 11, but works just as well once connected.
Note: The devices need to be on the same wifi network, and not be connected through VPN.