5

First : I know about abdWireless app. But my problem is different.

I am using my Android mobile as Mobile AP (Portable WiFi hotspot) for using internet on my computer. I want to use adb in wireless mode but the problem is - when i enable Mobile AP on my android mobile WiFi gets turned off and i am unable to use abdWireless app.

I want to use both wireless ADB and Portable WiFi hotspot at the same time. Is there any way to do it ???

1

On Android Device:

  • Make sure USB Debugging is enabled in Developer Options.
  • Set adb port prop:

    • If rooted: Open a terminal emulator (like termux) and run the following commands:

      su
      setprop service.adb.tcp.port 5555
      
    • If not rooted: Connect your device to PC using usb and run on PC terminal/cmd:

      adb tcpip 5555
      

      You can disconnect after this and continue on WiFi.

      Note: This step needs to be performed only once, but the prop is reset on boot, so you need to repeat this step after a reboot.

  • Get IP address:

    • If using mobile hotspot, the IP address of the device would be 192.168.43.1 by default.
    • If using an external WiFi, you can get the device's IP address by running in terminal emulator:

      ifconfig
      

      This will print a list, one of those would start with something like wlan0, with IP in the second line (mentioned as inet addr):

      wlan0     Link encap:UNSPEC  HWaddr ...
                inet addr:192.168.43.1  Bcast:192.168.43.255  Mask:255.255.255.0
                ....
      

On PC:

  • Make sure you're connected to the mobile hotspot or the same WiFi as the Android Device. (You might wanna ensure that you aren't simultaneously connected to another network, like ethernet.)
  • In the terminal/cmd, run:

    adb connect 192.168.43.1:5555 # The IP address of android device
    adb devices
    
  • 1
    Actually, 192.168.43.1 is hardcoded into Android, so it remains universal across all devices which can start a hotspot, so ifconfig is not necessary. – Firelord May 23 at 17:19
  • 1
    @Firelord Thanks for the info, didn't know that! Still, ifconfig will help if, say, you want to connect over an external wifi, to which both PC and Smartphone are connected. – aksh1618 May 24 at 8:32
0

On newer android versions (around 4.0 or so, do not know exactly), you can do this without the need for a 3rd part app.

First, enable WiFi tethering, and connect your computer to the hotspot.

Next, go to Settings->Developer Options and check ADB over TCP/IP.

Now, you have to get your device's local IP. All you have to do is open up terminal emulator, and enter the netcfg command.

Look for the line that has 'wifi' in it, and look to the far right - you should see an IP address. This is your device's local IP.

Now just go to your computer, and type:

adb connect <devices local IP>

into a terminal.

  • Since Android 6, netcfg has been replaced with ifconfig. But otherwise the step still applies – Xcalibur Oct 25 '18 at 0:24
0
  1. Enable adb over USB in settings of your Android device. With this, you can already use most of the apps from Market.

  2. In terminal in Android device, type setprop service.adb.tcp.port 5555

Most programs from Market do only second. For first, they need root (like ADB over Wifi Widget).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.