When I first update to new version of studio I tried to use this new WiFi debug feature and it was working at first time (using QR code or manually typing the code) but now it's stuck with "Connecting to device. This takes up to 2 minutes."
message for some time and then I get "There was an error pairing the device"
message. Before it would take a couple of seconds to connect. My device is Samsung S10 (12 Android)
Update:
Using real MAC for the current Wi-Fi network on Android devices doesn't really solves the issue:
Mb it helps in some cases, but after I tested it for a while it still can't connect from time to time so I have to manually open Wireless Debug screen on a Android device and check ip:port to enter manually adb connect ip:port
in Terminal.
IPs of devices never change. I set static for all devices in router's settings. It also doesn't help.
So for now none of these solutions solves the issue for good.
I still have to call the following in Terminal:
adb kill-server
net stop winnat
net start winnat
adb start-server
(net * winnat
- For windows)
Then switch Wi-Fi on the device to make it work again.
So I can't accept the answer yet, though some answers may help in some cases (but we need a 100% solution)