23

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?

Andrew T.
  • 16,898
  • 10
  • 77
  • 134
Real Noob
  • 331
  • 1
  • 2
  • 3

7 Answers7

24

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
Dragon X
  • 341
  • 2
  • 3
20

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

NOTE: 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
Slbox
  • 103
  • 1
Pedro
  • 301
  • 2
  • 2
2

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
  4. If not, adb connect ip:port
TankorSmash
  • 103
  • 4
Andy
  • 121
  • 2
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.

Andrew T.
  • 16,898
  • 10
  • 77
  • 134
1

On my OnePlus 12, I had to disable developer options and enable it again, then pair using a QR code and it worked.

PS: I tried many options like adb pair / adb connect and restarting the WiFi, but nothing worked.

Andrew T.
  • 16,898
  • 10
  • 77
  • 134
Mahesh
  • 111
  • 2
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.

hippietrail
  • 377
  • 1
  • 8
  • 23