Wi-Fi Debug (ADB) – There was an error pairing the device

Posted by

This error means Android Studio was not able to pair your mobile device with the computer using the 6-digit code over Wi-Fi. This issue is common and usually relates to either network settings, device configuration, or how pairing is being attempted.

Solutions

  • Same Wi-Fi Network Required:
    Make sure both your computer and your phone are connected to the exact same Wi-Fi network.
  • Disable Randomized MAC Address:
    On your phone, go to Wi-Fi settings for the connected network, then find the Privacy/MAC address section and set to “Device MAC” instead of “Randomized MAC”.
  • Restart Wireless Debugging:
    On your phone, turn off Wireless Debugging in Developer Options, then turn it back on.
  • Restart ADB Server:
    In Android Studio, go to Tools > Troubleshoot Device Connections > Restart ADB Server, or in terminal run:
adb kill-server
adb start-server
  • Then try pairing again.
  • Try Command Line Pairing:
    Open platform-tools folder and run:
adb pair <phone_ip>:<port>

Type the pairing code when prompted. Then run:

adb connect <phone_ip>:<port>
  • This works better in some cases than pairing from the Android Studio UI.
  • Allow Network Access for Android Studio:
    Make sure Android Studio and adb.exe have permission for local network access in your computer’s firewall/security settings.

Leave a Reply

Your email address will not be published. Required fields are marked *

0
Would love your thoughts, please comment.x
()
x