Android Studio wireless ADB error (10061)
AndroidAndroid StudioAdbAdbwirelessAndroid Problem Overview
It seems that wireless ADB has more and more issues each time I update Android Studio. Using 2.1.1, I'm now unable to connect to my tablet using the command:
adb connect <ip addr>
It results in the error:
unable to connect to <ip addr>:5555: cannot connect to <ip addr>:5555: No connection could be made because the target machine actively refused it. (10061)
This happens directly after approving the connection in the dialog box on the tablet. Before today I was forced to do an adb kill-server
prior to attempting to connect to the tablet but now that doesn't even help.
Android Solutions
Solution 1 - Android
Generally you can say this error is network related, check these items first:
-
make sure your computer and your device can see each other in network mostly this means they are connected to the same router, but in more advanced scenarios your device may be connected to a wireless router and you computer may be connected to you Local Area Network. what is important is they can see each other. you can check this by pinging you device ip address from you computer.
-
make sure there is no conflict with ip addresses, this might be very simple. but if you do not use DHCP server and you enter the ip addresses in you devices you could mistakenly entered same ip address in different devices
when you are sure about the network issues redo the famous steps
So when you connected by USB follow these commands:
-
stay connect via USB
-
connect to your WIFI network (computer and mobile device both)
-
ping DeviceIP (must be have ping to your device)
-
adb kill-server
-
adb usb
-
adb tcpip 5555
-
unplug usb cable (as per @captain_majid 's comment)
-
adb connect yourDeviceIP
-
adb devices
(must be see two device names , one of them is by deviceIP) -
unplug USB cable
Solution 2 - Android
when restart device then your port also channge so hit command below
1- adb kill-server
2- connect your phone to pc with usb cable
3- adb tcpip 5555
4- adb connect (your device ip):5555
Solution 3 - Android
Device and PC are connected to same network connection.
1 stay connect via USB
2 adb kill-server
3 adb usb
4 adb tcpip 5555
5 adb connect 192.168.43.1:5555
6 adb devices (must be see two device names , one of them is by deviceIP)
7 unplug USB cable
Solution 4 - Android
I had the same issue. These steps worked for me:
- connect your device with usb
- when your cmd already in AppData\Local\Android\Sdk\platform-tools>,type
adb tcpip 5555
- the cmd will show
restarting in TCP mode port: 5555
- type
adb connect 192.168.43.1:5555
Hope this can solve your issue.
Solution 5 - Android
I recently faced the same problem. It occurs because your device and PC are connected to different Networks.
Solution 6 - Android
when restart device then your port also channge so hit command below
1- adb kill-server
2- adb tcpip 5555
3- adb connect (your device ip):5555
Solution 7 - Android
In case of me, i tried different port 5557 than again 5555,
- adb tcpip 5557
- adb connect device_ip_address
gives same error(10061) than again tried with,
- adb tcpip 5555
- adb connect device_ip_address
result: connected
that works for me(while the other thing is ok like as developer option is on and connected to same wifi)
Solution 8 - Android
Make sure you have to connect your phone through a USB cable for the first time.
Using Command prompt, Go to your Android SDK Directory (sdk->Platform-tools) and then
run the following commands
1- adb kill-server
2- adb tcpip 5555
3- adb connect 192.168.1.130 (Replace IP Address with your phone IP)
4- Now you can unplug it.
5- Then go to the Android studio and choose the device with IP address in
Run
Dropdown. Hope this will help it for everyone.
And then for next times just runs following command
adb connect 192.168.1.130:5555
Note: If Device is not showing in Android studio devices dropdown then
connect **USB** and run following commands
1-adb kill-server
2-adb usb
3-adb tcpip 5555
4-adb connect 192.168.1.130:5555
Solution 9 - Android
You must connect the mobile device via USB first, then type adb tcpip 5555
,
and then enter your device IP adb connect <your_device_ip>
Solution 10 - Android
I got this error when I had Bluestacks emulator started together with my phone attached. When I typed in command prompt adb devices I could see two devices:
adb devices
List of devices attached
dfdcdc9c device
emulator-5554 device
Before typing adb connect
adb -s dfdcdc9c tcpip 5555
adb -s dfdcdc9c connect <ip addr>
Solution 11 - Android
I solved the problem by enabling USB Debugging in Developer Options.
Solution 12 - Android
Unfortunately this issue can be caused by different reasons. One of the reasons - make sure previous communication is disconnected.
USE:
- adb kill-server
- Issue command adb disconnect after restarting adb server. Do same thing after finishing job
- run adb remount
- adb tcpip 50555 (I usually use higher port number)
- unplug USB cable
- adb connect device_ip:50555
when done run adb disconnect
Solution 13 - Android
I had same issue with Android Studio 3.5.2, here is how i solved it.
-
First you must connect your device via USB once. (Debugging mode starts only when usb is connected)
-
Go to command prompt : adb tcpip 5555 (watch for port on which adb started) then : adb connect
: -
After successful connection goto Studio>Run>Select Device.
Solution 14 - Android
I assume you already solved the problem by now. but here is the way to avoid the problem if you are using multiple devices. I used to have the same issue so many times until I understand, how it works. I was also trying to connect multiple devices one after another or trying to connect the same device after a while.
Always make sure to disconnect the older device before you connect the new device:
adb disconnect
after that, you will be easily able to connect new device:
adb tcpip 5555
adb connect <your_device_ip>
you can always try to ping the device using the ping command, if the ping is not getting acknowledgment then you must have connected to different wifi then your laptop or you haven't connected to wifi at all:
ping <your_device_ip>
Solution 15 - Android
Usually the 'target machine actively refused it' message is displayed when the target machine's 'ADB debugging' feature is not turned ON. It is turned off by default in almost all devices unless we enable 'developer options'. So whenever you land on this error, make sure you go to the settings of your target machine and trickle to the developer/development area and somewhere there should be a place to enable ADB.
Solution 16 - Android
Following steps are standard ones to follow( mostly same as previous answers):-
- adb tcpip 5555.
- adb connect your_device_ip_address.
- adb devices (to see if devices got connected).
But in some cases above steps gives error like "unable to connect to device. Make sure that your computer and your device are connected to the same WiFi network." And you notice the devices are already on the same network.
In this case, install this plugin "Wifi ADB Ultimate" and follow below steps.
Solution 17 - Android
After weeks of struggle and trying different approaches while everything was right and on the same network (ping {ip}
was coming back positive) I figured the dumb debug bridge does not look for all network adapters to find the device! The device got connected when I manually disabled all other network adapters except the one (WiFi adapter) which was required to connect.
Solution 18 - Android
Step 1. Type command in terminal adb tcpip 5555
Step 2. Type command in terminal adb connect
Now check in studio device Monitor tool your phone connected without wire.
Note :- Most important your Laptop & Mobile Device Connected with same Network
Solution 19 - Android
I had the same issue and I thought it might be because of the network and tried many solutions but didn't work. Lastly, I checked my IP address which was updated for my device and was the root cause for this.
So please check the IP address first and use adb tcpip <port>
to start listening the connection and adb connect <IP>:<PORT>
Solution 20 - Android
I had a similar problem. I found out the problem was if I had other devices/emulators connected to the adb already, the "adb connect <ip_addr>" command would give me the "No connection could be made because the target machine actively refused it" message.
The solution is to make sure all the other devices/emulators are disconnected (either physically disconnect or quit the emulator application) before running adb connect <ip_addr>. You can then reconnect your other devices (if you need them reconnected). A total pain.
Your mileage to this solution may vary depending on your problem.
Solution 21 - Android
I got this error when trying to establish an ADB connection to a smartwatch with WearOS 1.0 (Huawei Watch 2) via WiFi. Enabling the menu entry for fixing some WLAN issue ("Fix error via WLAN" -- my own rough translation of the German caption "Fehler über WLAN beheben") in the "Developer options" on the WearOS device solved the issue for me.
Solution 22 - Android
I had the same issue. It was working perfectly for a month, and then one day it stopped working. I tried all the solutions above, but to no avail. Then, I noticed that for some reason, the IP address of my phone had changed, ending with the number 1 instead of 0. So I connected to the new address with 1 as the last digit in the address and now it works again. Weird.
Solution 23 - Android
In my case I played with my device long enough to somehow mess up adb deamon, so port number was not set up correctly anymore.
getprop service.adb.tcp.port
returned empty string.
So I solved this with following commands:
stop adbd
setprop service.adb.tcp.port 5555
start adbd
I ran all commands on rooted device in app that emulates command prompt.
Solution 24 - Android
So I came here because I want to adb shell
into my physical Android phone over the network. Lots of useful answers are provided, but the most obvious fact is never stated. Here is the #0 fact:
- The Android phone should ALWAYS be connected via USB to the laptop
- And then another different laptop will do
adb connect ...
This was not what I had in mind and all the above answers never mentioned it.
Solution 25 - Android
Solution 26 - Android
I had a problem with my Huawei. For some reason I had wrong drivers, on Device Manager it was showed like "Android Phone". Then, I updated the drivers from Device Manager, I choose another driver and now it is showed as "Huawei" device.
From there I connected my device whitout problem (adb connect IP:5555)
Solution 27 - Android
For Android TV, Connect PC and TV in the same network (wi-fi), enable developer option, and go to developer option and enable ADB debugging option.Then run the commands given below
1. ping <ur IP> (check the connection)
2. adb disconnect (to remove all the previous connections)
3. adb connect <Ur IP>
4. adb install app_name.apk
Solution 28 - Android
I have attempted to use many solutions above to no avail and found some pretty simple solution that works for myself.
If you are using a real device to debug like me, you may check the device official website to download the android USB driver for your development environment.
I'm using Samsung phone to debug and using windows as development environment thus I went here, download the Android USB Drivers for Windows and run it.
It resolves my ADB problem.
Solution 29 - Android
For anyone who is Android 11+
- Enable Developer Options
- Enable Wireless Debugging
- Allow wireless debugging on this network.
- Pair Device with Pairing code
- Type in
adb pair [Phone_IPAddress]:[PORT] [PAIRING CODE]
- After Successfully Pairing. Type
adb connect [Phone_IPAddress]:[PORT]
For more info: ADB Documentation
Solution 30 - Android
In my case my device is ping-able also but couldn't connect using adb connect
Before:>adb connect 25.161.247.230 cannot connect to 25.161.247.230:5555: No connection could be made because the target machine actively refused it. (10061)
After:adb connect 26.165.124.26 connected to 26.165.124.26:5555
Solution 31 - Android
Check Mobile IP then
adb connect <IP>:5555
ckeck also
in Developer Options
make sure disable adb authorization timeout
it's on
ايقاف مهلة تفويض أداة adb
Solution 32 - Android
Try this way change adb
to .\adb
PS C:\users\mori\appdata\local\android\sdk\platform-tools> .\adb kill-server
PS C:\users\mori\appdata\local\android\sdk\platform-tools> .\adb usb
PS C:\users\mori\appdata\local\android\sdk\platform-tools> .\adb tcpip 5555
PS C:\users\mori\appdata\local\android\sdk\platform-tools> .\adb connect 192.168.1.34:5555
connected to 192.168.1.34:5555
Solution 33 - Android
In my case, it was just the wrong android device IP address. I fixed it by looking for it in the settings.
Solution 34 - Android
I resolve the problem like that :
- on Android device activate the developer mode (Setting->Device->Build 7 time)
- In developer mode activate debugging mode
- then adb connect xx.xx.xx.xx
- then a windows appear in android, click accept the connexion
Michael