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)

- 8,146
- 7
- 57
- 139
-
3I'm having the same issue this morning... did you find a solution? – Don Madrino Feb 27 '22 at 13:42
-
i have the same device and the same problem. Hope there is a solution. – Nikola Feb 27 '22 at 22:19
-
Same problem on samsung device, but after I switch off and on wireless debugging again it connected. – Miftakhul Arzak Jun 28 '22 at 12:54
-
@DonMadrino https://stackoverflow.com/a/72797607/7767664 – user924 Jun 29 '22 at 07:46
-
@Nikola https://stackoverflow.com/a/72797607/7767664 – user924 Jun 29 '22 at 07:46
8 Answers
EDIT 2: Take a look at the below answers, the actual reason seems to be that the device is assigned a random IP or a MAC via DHCP, if you can disable that via system settings for your specific custom ROM, then it's even better
EDIT: If you see regular disconnections, click on `Pair Device with Pairing Code`, and then pair your device with the following command
adb pair <ip-addr>:<port> <pairing_code>
I was facing the same issue, what I did was switching to the command line way of connecting with the device. You can do so in the following way
- Make sure
USB Debugging
is enabled on the device you intend to connect with - In your device, go to
Developer Settings>Wireless Debugging
and you will see something like so
- Now carefully look at the
IP ADDRESS AND PORT
section and type the following in the terminal
adb connect <ip-addr>:<port>
And your computer will show under paired devices like the above screenshot

- 1,830
- 1
- 13
- 25
-
The second way does not work. I get "no route to host" and tcpip throws an error saying their are no devices. – John Glen Jun 05 '22 at 16:41
-
3
-
2"Make sure USB Debugging is enabled on the device you intend to connect with" is important ... even though you are using Wireless debugging, if USB debugging is not on, it just doesn't work. – Marc Durdin Jul 22 '22 at 01:55
-
Restarting the Android device fixed "Unable to start pairing" this issue for me – Cyph3rCod3r Jul 27 '22 at 07:12
-
Even worse, I get the following message in the terminal, "adb : The term 'adb' is not recognized as the name of a cmdlet, function, script file, or operable program." – EddieRich Jul 28 '23 at 13:16
I was able to resolve the issue from within Wi-Fi settings by disabling the Randomized MAC Address feature under Privacy. Using my device's actual MAC address fixes the issue.

- 416
- 4
- 6
I had the same problem but I managed to find the solution. You have to follow the following steps:
- In your smartphone (Go to Settings->Developer options-> Wireless Debugging->Pair device with pairing code).
- Copy the ipaddress & port. For example: 192.168.1.2:42123 and wifi pairing code: 234321.
- Open your terminal and go to the following path: cd %LOCALAPPDATA%/Android/sdk/platform-tools
- Paste the following command following this order: adb pair (ipaddress & port that you saw when you clicked on "Pair device with pairing code") abd pair 192.168.1.2:42123
- Paste the access code to the wifi connection. Enter pairing code: 41107.
- Finally, on the same screen go to the option that says IP address and port and you will see the same address but with another port (You can find it in this part of your screen), copy it and write the following command: adb connect 192.168.1.2:41107
If you see a message like this "connected to 192.168.1.2:41107", you did it you will be able to connect your phone with android studio without any problem.
I fixed it by manually assigning IP addresses for my smartphone and PC at settings of the router. Basically avoiding DHCP.
Restarted the router.
Cleared old pairing.
Started pairing again and now it works fine all the time, and no need to repeat pairing process, just enabling "Wireless debugging" from notification panel and in couple of seconds the device will be available in Android Studio
So next time just enable "Wireless debugging" and it's ready
I don't know why there the issue with dynamic IPs

- 8,146
- 7
- 57
- 139
Note that for me pairing wouldn't work while I was on my VPN. After I paired while off the VPN, I could adb connect ipaddress:port
and it worked.

- 1,803
- 2
- 17
- 27
This worked for me:
- Tools --> Troubleshoot Device Connections
- Press Next --> Next
- Click 'Restart ADB server'
- Freshly turn ON Wireless Debugging on device and wait for few seconds.

- 1,996
- 1
- 20
- 23
This really helped me
Using Terminal Tool
type: adb pair {ip_address}:{port} {pairing_code}

- 13
- 7
Important reminder and this is what solved my problem.
Devices must be on the same network.

- 1,395
- 4
- 19
- 30