ADB over Mobile Hotspot

I have been wondering if there is a way to debug over mobile hotspot rather than on wifi. ADB over wifi works fine when in wifi connectivity but when there is no wifi, situation is different. There are no apps that provide with such functionality. But there is a catch. You just have to be connected to the device and so you are when connected to portable mobile hotspot. Here is the similar way as debugging over wifi.

The catch is to find the IP address of the mobile.

You can do this by installing “Termux” (terminal emulator for smartphones) or you can access the phone’s terminal to get the IP address.

Enable usb debugging and connect the phone via USB and type the following in the terminal window.

adb shell

This allows you to access the phone’s terminal through your computer.

Open your phone’s portable hotspot. Then type the following command for network configurations of the phone.

ifconfig

Look for “inet addr” in “wlan0”. This is the IP we want(192.168.***.***)

Connect to the mobile via wifi from your computer. In a new terminal window type the regular commands when we debug over wifi.

adb tcpip 5555
adb connect <The ip which we got above(192.168.***.***)>:<port number(here 5555)>

Voila, you just connected to your phone over phone’s. Remove usb and type “adb devices” , you will see your phone connected.