0

I am trying to connect my Realme Mobile ,(Working on Android 13, Updated to latest version) and facing difficult to connect my phone to Android Studio on MAC for wireless debugging.

I tried to connect through QR scanner method but as soon as I scan the code, I get no response and even after scanning for > 2 minutes, nothing is happening.

Also the pairing code method is not working. Most of the times my device is never showed up in list. And If it is then the TCP port is outdated and after entering the pairing code, it displays that it is failed to connect.

Even if the TCP port is correct then many times it shows that it will take 2 minutes to connect but it never connects.

The success ratio to connect is 1/100.

Please suggest the best possible setting for android phone and MAC laptop for wireless debugging.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141

1 Answers1

0

As a precaution, make sure Developers option and wireless debugging are enabled and you have latest SDK platform tools installed:-

  1. Goto Sdk manager > SDK Platforms > check "show package details" (at bottom right corner.)

  2. Expand the latest stable Android release (currently Tiramisu) > and check Android SDK platform (currently 33) if not already checked/ installed.

  3. Hit apply and allow the installation to complete if needed.

Fix 1

  1. In Android Studio, File -> Settings

  2. Build, Execution, Deployment -> Debugger

  3. Under Android Debug Bridge (adb), uncheck 'Enable adb mDNS for wireless debugging' and Apply

  4. Wait some seconds for changes to take effect

  5. Recheck 'adb mDNS for wireless debugging' and Apply

  6. On the pop-up window from Windows Defender, allow network access to adb.

Try pairing again, if it doesn't work or you may get An error accoured connecting device... Try the next Fix.

Fix 2

On Windows, some users were able to fix this by disabling virtual network adapters for VPNs or VMs like here Macs "may" have virtual adapters so check that out or skip to next step.

Fix 3

  1. Goto your Android/sdk/platform-tools folder.

For Windows, the default location is: C:\Users\[User]\AppData\Local\Android\Sdk\platform-tools (but like me you may have moved the folder around, so check that.)

  1. Open the cmd or Terminal (mac) there.
    • In windows you can do this by clicking the folder path in adress-bar of windows explorer, and typing cmd and hitting enter there.
    • Alternatively, you can do this by opening terminal anywhere and typing cd [path to platform-tools directory on your PC]

If your PC appers under PAIRED DEVICES on your android, then skip to step 6, else

  1. Find your IP address, port number, and pairing code by selecting Pair device with pairing code. Take note of the IP address, port number, and pairing code displayed on the device.

  2. On terminal you opened, run adb pair ipaddr:port. Use the IP address and port number from above.

  3. When prompted, enter the pairing code, as shown here

*P.S: these steps are also avilable here from google, but for some reason they didn't mention the steps above.

  1. After your device is sucessfully paired, run adb connect ip:port. the ip:port that is visible in the main page of Wireless debugging here.

With This, hopefully the device will be connected.

Sources

you can check my complete answer here or orignal fixes from orignal finders below. I have edited my answer to avoid it being an exact duplicate, but the thing is no one knows, what is the actual cause and which fix may or may not work, like fix 2 worked for me once, then i messed around and the problem came again.

If any of this helped you, please consider upvoting, I am new here and need some reps to upvote other answers and make comments.

AbdulAhad
  • 1
  • 1