'Android ADB - failed to connect to '192.168.1.4:5037': Connection refused

When I try to connect my mobile device using adb connect 192.168.1.4:5037 i get failed to connect to '192.168.1.4:5037': Connection refused error sometimes.

How can I fix this? This issue happens intermittently. What is the reason behind this & how to fix it?

I even tried killing and restarting adb server

My steps

adb tcpip 5555
adb connect 192.168.1.4:5555

Additional Info

  1. Device - Poco F1
  2. Android - 10


Solution 1:[1]

You need to run adb tcpip 5555 with the USB cable plugged in - and then unplug.

Solution 2:[2]

Try following these instructions:

  1. Open the command prompt and navigate to your sdk/platform-tools/ folder.

  2. Type adb tcpip 5555 with your device plugged in

  3. Type adb connect <your device ip address>:5555

  4. At this point you unplug your device and type adb logcat

  5. At times, such as unplugging/plugging into a USB device, the logcat will become disconnected, just redo steps 3 & 4.

Solution 3:[3]

  1. ping 192.168.1.4 to see if this IP is online.
  2. telnet 192.168.1.4 5555 to see if this port is online.

Solution 4:[4]

Phone should be connected over USB cable before making connection over Wi-Fi. Once you successfully connected to the device you can unplug the cable.

Just in case, try

adb kill-server

to restart the server

And make sure developer settings and USB debugging enabled, so it must be working via USB cable

Solution 5:[5]

Option I: This might happen when your device keeps changing IP addresses, since WiFi is sometimes switched on and off, and when you get a DHCP lease from your server/Access Point it might change. Keeping your device plugged in via USB (not necessarily to the host, but to any charger), or keeping screen on will ensure it's at the same address, and - assuming that you have the address right and you used adb tcpip (or set the adb TCP property in the shell) it should work.

Option II: You have the port number wrong. "Connection refused" means you got to the IP address, but the port isn't listening. Up there in your question you first state 5037, then 5555?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Martin Zeitler
Solution 2 Alfaizkhan
Solution 3 BaiJiFeiLong
Solution 4 Abdulaziz Abduqodirov
Solution 5