Reputation: 472
I am having trouble enabling wireless debugging in Android Studio. In fact when I select "Pair Devices using Wi-Fi", I get an almost instant error with the very general (useless) message "unexpected error during Wi-Fi pairing initialization". I was very surprised being that I was unable to find any posts or pages when googling for that specific message!
Android Studio provides a "learn more" link that opens up this page and is basically useless—it describes basic steps which I will copy below. I can't find any logs or more specific error messages. I tried rebooting the PC, restarting Android Studio, turning off any firewalls/anti virus, trying with phone plugged in (USB debugging works fine, I can load apps to the phone when plugged in no problem), ADB restart, updated Android Studio and SDK platform tools. Nothing changes; it is the same message (see the screenshot at the bottom).
What bugs me is that because the error message pops up almost instantly, the whole "service" seems to be unable to start completely. I have researched extensively, but most errors are quite specific and deal with network/IP issues or pairing problems, etc.—but all those are after some initial steps do take place.
I am running Android Studio 15 (Dolphin) | 2021.3.1.
I have a Samsung s21FE running Android 12 (although I don't think that is even relevant, it never starts looking for devices anyway).
I have followed all steps in relevant guides, for example here, namely:
The error I see is this:
I solved it by following a suggestion from the comments submitted on this post. See below.
Upvotes: 27
Views: 16591
Reputation: 627
Please ensure you are running Android Studio as an Administrator on Windows, and that adb.exe does indeed have the correct firewall permissions.
Upvotes: 0
Reputation: 1
I fixed it by downloading the latest SDK platform here the link. https://developer.android.com/tools/releases/platform-tools After download go to file manager >localdisk C>Users>name>AppData>Local>Android>Sdk paste the new downloaded platform-tools
Upvotes: 0
Reputation: 89
It worked for me by killing adb.exe
from Task Manager.
Task Manager > Processes > Apps > Android Studio > adb.exe
AND
Task Manager > Details > adb.exe
Upvotes: 4
Reputation: 121
I had to:
adb pair [ip.address]:[port displayed on device]
Pair Device w/ Pairing code Screenadb connect [ip.address]:[port listed in Wireless debugging]
- This is different than the previous port used and is shown in the main section of Wireless Debugging
Device IP/Portadb shell
to test or go directly to Android Studio and the device is listed in "Device Manager"Upvotes: 12
Reputation: 1645
I had the same issue being within a corporate VPN on Windows.
I solved it following below steps (of which some might be optinal):
.\adb pair [real ip address]:[pairing port]
.\adb connect [real ip address]:[connect port]
Upvotes: 1
Reputation: 724
Try upgrading the SDK Platform tools in menu Tools → SDK Manager → SDK Tools.
Upvotes: 39
Reputation: 171
I have fixed this problem by closing Android Studio and opening it again.
Upvotes: 7