No connection could be made because the target machine actively refused it. (10061)

off99555 picture off99555 · Aug 7, 2019 · Viewed 14.9k times · Source

I have problems trying to do wireless debugging.

I followed this instruction: https://developer.android.com/studio/command-line/adb#wireless

And it seems that I cannot connect to my phone at step 7 of the article adb connect device_ip_address.

It said cannot connect to 192.168.1.35:5555: No connection could be made because the target machine actively refused it. (10061)

I tried searching for the solution in stackoverflow but the answers do not suit my situation. They said to make sure that I connect to the same network and I'm pretty sure I am connected to the same network. I see my phone is connected to wifi name "Chor" And PC is also connected to the same name. I can even ping phone IP in the command prompt and receive a good response.

Any clues about what could be the issue? The phone I use is Huawei P30 Lite. I'm using Windows 10.

Answer

Shiva_Adasule picture Shiva_Adasule · Aug 18, 2020

that Occurs due to

  1. device is Restarted
  2. device is connected to another computer or computer is debugging another device
  3. turn offing the developer options of device

Follow those Steps to resolve that problem,

  1. Connect your device to PC by USB cable to pc(one time requirement) and and turn on usb debugging it will connect successfully, allow for connection in device for promoted message. 2)then type this Command in terminal "adb tcpip 5555"
  2. now remove the USB cable and connect device with pc with wifi
  3. now type this command "adb connect <your_ip>"
  4. you're all done !!