Android Studio wireless ADB error (10061)

AndroidAndroid StudioAdbAdbwireless

Android 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:

  1. stay connect via USB

  2. connect to your WIFI network (computer and mobile device both)

  3. ping DeviceIP (must be have ping to your device)

  4. adb kill-server

  5. adb usb

  6. adb tcpip 5555

  7. unplug usb cable (as per @captain_majid 's comment)

  8. adb connect yourDeviceIP

  9. adb devices (must be see two device names , one of them is by deviceIP)

  10. unplug USB cable

Steps from https://stackoverflow.com/questions/34327974/could-not-connect-to-tcp5037-cannot-connect-to-127-0-0-15037-no-connection-c

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:

  1. connect your device with usb
  2. when your cmd already in AppData\Local\Android\Sdk\platform-tools>,type adb tcpip 5555
  3. the cmd will show restarting in TCP mode port: 5555
  4. 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,

  1. adb tcpip 5557
  2. adb connect device_ip_address

gives same error(10061) than again tried with,

  1. adb tcpip 5555
  2. 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 I had to type -s and device ID:

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:

  1. adb kill-server
  2. Issue command adb disconnect after restarting adb server. Do same thing after finishing job
  3. run adb remount
  4. adb tcpip 50555 (I usually use higher port number)
  5. unplug USB cable
  6. 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.

  1. First you must connect your device via USB once. (Debugging mode starts only when usb is connected)

  2. Go to command prompt : adb tcpip 5555 (watch for port on which adb started) then : adb connect :

  3. 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.

  1. Connect the device once through USB.
  2. Refresh the list to check whether its connected.
  3. Go to About Phone > Status > IP Address and note your IP address(e.g. 198.162.0.105).
  4. Come back to Android Studio and fill in this IP as done in below photo and hit the run button. enter image description here

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 :5555

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>

enter image description here

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

Go to Android Studio File - Settings enter image description here Next..

enter image description here

Happy Codding :)

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.

enter image description here

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+

  1. Enable Developer Options
  2. Enable Wireless Debugging
  3. Allow wireless debugging on this network.
  4. Pair Device with Pairing code
  5. Type in adb pair [Phone_IPAddress]:[PORT] [PAIRING CODE]
  6. 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 syntax. so, i just simply turned on flight mode on both laptop and smartphone and voila it worked.

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 disable adb authorization timeout

ايقاف مهلة تفويض أداة 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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLuke AllisonView Question on Stackoverflow
Solution 1 - AndroidMuhammad NaderiView Answer on Stackoverflow
Solution 2 - AndroidrushikeshmoreView Answer on Stackoverflow
Solution 3 - AndroidRahul PatelView Answer on Stackoverflow
Solution 4 - AndroidYudiriusView Answer on Stackoverflow
Solution 5 - AndroidHardy AndroidView Answer on Stackoverflow
Solution 6 - AndroidAnish Kumar GuptaView Answer on Stackoverflow
Solution 7 - AndroidBashir FardoushView Answer on Stackoverflow
Solution 8 - AndroidAbdul MateenView Answer on Stackoverflow
Solution 9 - AndroidPraveen AanandView Answer on Stackoverflow
Solution 10 - AndroidaxilosView Answer on Stackoverflow
Solution 11 - AndroidWaleed AbdalmajeedView Answer on Stackoverflow
Solution 12 - Android999masksView Answer on Stackoverflow
Solution 13 - AndroidBrownView Answer on Stackoverflow
Solution 14 - Androidpatel dhruvalView Answer on Stackoverflow
Solution 15 - AndroidjohnmanoahsView Answer on Stackoverflow
Solution 16 - AndroidPrashant PaliwalView Answer on Stackoverflow
Solution 17 - AndroidSdghasemiView Answer on Stackoverflow
Solution 18 - AndroidManoj RawatView Answer on Stackoverflow
Solution 19 - AndroidMinionView Answer on Stackoverflow
Solution 20 - AndroidONEView Answer on Stackoverflow
Solution 21 - Androiduser1364368View Answer on Stackoverflow
Solution 22 - AndroidbranView Answer on Stackoverflow
Solution 23 - AndroidBrontesView Answer on Stackoverflow
Solution 24 - AndroideigenfieldView Answer on Stackoverflow
Solution 25 - AndroidSahil ChoudharyView Answer on Stackoverflow
Solution 26 - AndroidMike AguilarView Answer on Stackoverflow
Solution 27 - AndroidVineesh KalarickalView Answer on Stackoverflow
Solution 28 - AndroidL.K.M RanudipuraView Answer on Stackoverflow
Solution 29 - AndroidDrPleaseRespectView Answer on Stackoverflow
Solution 30 - Androidpankaj kumarView Answer on Stackoverflow
Solution 31 - AndroidمصطفىView Answer on Stackoverflow
Solution 32 - AndroidMoriView Answer on Stackoverflow
Solution 33 - AndroidPiyushView Answer on Stackoverflow
Solution 34 - AndroidMichael GurionView Answer on Stackoverflow