16

I am using the Android Studio Chipmunk edition. My Android device is connected to the WiFi and my PC is connected to the same router through ethernet cable. My devices are running Android 12. So, it seems like I am fulfilling all the requirements.

I was able to connect a few times and able to install apps wirelessly. However, I am failing now. One of the following two things happens each time:

  • The QR scanner does not do anything when I scan the code as if it didn't recognize the QR code at all.
  • The QR code is recognized and I get a message about the pairing taking a while.

I also tried using the six-digit code for pairing by none of my devices are showing up under "Available Wi-fi Devices".

What am I doing wrong?

2

6 Answers 6

16

Same happened with me but this fixed the issues:

Run: adb connect <IP address>:<Port> in your terminal whenever your mobile fails to connect.

You can find the IP and port in your phone's settings Settings>Developer Option>Wireless Debugging.

If it gives any error, add a path of your android sdk platform tools in Environment variables [For me it was C:\Users\<username>\AppData\Local\Android\Sdk\platform-tools]

If you can't see AppData folder then turn on the option to view hidden folders from control panel.

In case you don't know how to add a new path in Environment Variable then:

  1. Search Edit environment variables in your Windows search bar and click on the result option.
  2. Click on Path>Edit...>New
  3. Add the path and click Ok > Ok
1
  • 1
    I got an error saying "failed to connect to 192........" May 26, 2023 at 5:40
6

You first need to pair device with:

adb pair IP:PORT

You need to get IP, PORT and the pair code from android Wirelesss debugging menu (be careful, the pairing PORT is different from the connect PORT).

Then, when asked to prompt code, enter the code you see on your phone.

Finally, connect with:

adb connect IP:PORT
1

On Windows, I had to allow adb.exe through the Microsoft Defender firewall for this to work:

  1. Press the Windows key
  2. Search for "Allow an app through Windows Firewall" and press Enter
  3. Make sure adb.exe is allowed in there

I also had to connect both the PC and the phone to the WiFi only. Having the PC connected to ethernet only caused similar issues.

1
  • The above plus a restart of my PC solved it. Dec 28, 2023 at 7:34
1

None of the answers actually worked for me. What did the trick was to:

  1. On Android Wireless Debugging > Pair device with pairing code
  2. On cmd do adb pair ip:port with ip/port from above
  3. Device now appears on Android Studio > Device Manager
0

Sometimes putting my phone in Airplane mode for 5-10 seconds and then turning it off resets the connection and allows me to wirelessly connect to the device. If that doesn't work I will try turning the computer's wifi off and on too. Sometimes it works, sometimes it doesn't. Recently I wasn't able to connect wirelessly to my main computer, and it wouldn't work until I connected to a different one.

0

You did not talk about enabling Wireless USB debugging in the dev options. If you don't do it you should get an error which says that the connection has been denied by Android.

You should try to ping your phone. If the ping works, open a cmd and type 'adb connect 192.168.X.X' with the IP of your Android device.

Obviously your phone and computer have to be on the same network.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .