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

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 !!

I have accidentally found the solution now!

It seems to be a phone issue (specifically Huawei phone). It keeps turning off USB debugging mode by itself so what I had to do was to prevent it from turning off USB debugging mode.

I am not clearly sure of what is the exact step that fixed the issue but here's everything I did in Developer options:

  • Revoke USB debugging authorizations
  • Allow ADB debugging in charge only mode (I think this fixed the issue)
  • Turn off Always prompt when connecting to USB

Seems like there are some bugs with authorization conditions across different manufacturers. To get your target device to trust your computer, you need to go through more than just approving the computer's MAC address.

After some modifications of @off99555's answer, this is the solution for OnePlus 7 T/Pro devices on OxygenOS 10 (Android 10.x). Might be device manufacturer specific:

  1. Revoke USB debugging authorizations
  2. Connect target device via USB
  3. Change USB usage mode to "File Transfer"
  4. Run 'adb connect 192.168.x.x:5555'

The target device should recognize your computer now, and you can unplug USB and use ADB wireless now. Note that if you revoke USB auth in the future, you will have go through these steps again.