7

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

Tour Rich
  • 71
  • 1
  • 1
  • 2
  • 1
    Does this answer your question? [Android Studio wireless ADB error (10061)](https://stackoverflow.com/questions/37267335/android-studio-wireless-adb-error-10061) – Zain Apr 24 '20 at 05:07
  • Did you run this command `adb -s tcpip 5555` before adb connect? – Rajen Raiyarela Apr 24 '20 at 05:11
  • 1
    **TL;DR:** Google actively and deliberately made this not possible. You will not find a solution below. **The only correct answer is to not buy any product over which you don’t have full control.** As such devices are crimes that are strangely still “legal”. Prevent such organized crime (Yes, organized crime. I has to be said.), and buy one of the many phones where the bootloader is not locked. E.g. a Fairpone. – Evi1M4chine Jan 13 '22 at 06:29

5 Answers5

6

In latest updates of Android Studio, you can easily pair your device wirelessly

Go to Device Manager > Physical > Pair using Wi-Fi

Then go to your phone's settings Developer options > Wireless debugging > Pair using QR code Your phone will be connected to Android Studio after scanning the QR code

Note: this feature works on Android 11+ devices

Old Devices

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

ASHKARAN
  • 365
  • 1
  • 13
  • 13
    Yes, I tried the above commands. But the problem is that I want to connect my android to ADB without cable and also want to gain root access through terminal. I couldn't achieve this target. I made sure that my Laptop and Android are connected to the same wifi network. – Tour Rich Apr 25 '20 at 06:04
  • 1
    first of all you have to use cable, then, after connecting throw wireless you can unplug your phone and work wireless – ASHKARAN Apr 25 '20 at 21:03
6

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+

jns
  • 1,250
  • 1
  • 13
  • 29
0

Please follow the below link to get the detailed answer :

https://developer.android.com/studio/run/device

And one more think , don't connect your mobile with charger while connecting the android studio to mobile without usb cable.

sathi raj
  • 45
  • 8
0

In android 11 device and above there is direct way to use wifi debugging. Make sure your computer and your android device are in same wifi network. Then follow the steps -

    1. Open terminal in the directory of adb. So for windows Open cmd in ...\AppData\Local\Android\sdk\platform-tools

    2. Run `adb devices` to confirm that no device is connected

    3. run `adb connect <IP address of your device>:5555` 

    4. Run `adb devices` again, it should show your physical device.

May be you have to install any app through usb debugging by connecting usb first. Then afterwards the above method works for that phone (My Android Studio version is Flamingo 2022.2.1).

In linux use ./adb instead of adb. Go to the Settings -> About phone -> All Specs -> Status to view the IP address of your phone.

Jayanta
  • 11
  • 2
-1

Connect to DNS Server IPv4 address instead of just IPv4 address. Check in your wireless properties.