How to connect ADB over wifi network without usb cable?

I want to connect my adb to real-time android, not to emulator but it gives an error: "cannot connect to 192.168.10.4:5555: No connection could be made because the target machine actively refused it. (10061)" I tried this command: adb connect


It is possible starting with Android 11. On the phone click Pair device with pairing code, then on the dev machine do the following:

cd myandroidsdk/platform-tools
adb pair ipaddr:port

Take ipaddr and port from your phone. The terminal will then prompt you to put in the pairing code.

https://developer.android.com/studio/command-line/adb#connect-to-a-device-over-wi-fi-android-11+


Make sure your phone and laptop are connected to the same router

  • connect your phone to your laptop with usb cable
  • open a terminal window
  • adb devices

    shell response should be something like this:

    List of devices attached E1MGAP2810904770 device

  • adb tcpip 5556

  • adb connect 192.168.1.47:5556

    shell response should be something like this:

    connected to 192.168.1.47:5556

change the 192.168.1.47 with your local IP address.

you can find your phone's IP Address in Settings -> Status ...