Relaso

How to debug / connect to Android mobile using adb over WiFi on non-rooted devices (will work for rooted devices also)

June 25th, 2014

The following guide will teach you how to connect with (non-rooted as well as rooted) Android devices using adb over WiFi. I tested it with several non-rooted devices including Moto G, Nexus 1, Videocon mobiles etc.

Steps (require Console / Cmd prompt and adb in path):

1. Attach mobile via USB and type:
adb tcpip 5555

2. Remove USB cable and then type:
adb connect mobile-ip:5555

That’s it!

Note:
To find mobile ip type:
adb shell ip -f inet addr show wlan0

The ip address will be shown in second line like this:

inet 192.168.1.233/24 brd 192.168.1.255 scope global wlan0
where 192.168.1.233 is the ip address of your mobile.

Notes:

1. The connect command can be repeated as many times as you wish, should the mobile no longer show in ‘adb devices’ list.

2. Remember that leaving the mobile with adbd running on tcp/ip makes it vulnerable to hacking over WiFi. So after you are done debugging you can set it back to listening over usb with:

adb usb

To connect over tcp-ip again, you need to repeat step 1 and then 2, as before.

You may notice the adb connection gets disconnected when unused for sometime. To prevent it run ping on the device like this:

ping -i 240 android-ip

This will ping the Android every 4 minutes and keep the connection alive.

Share to spread the knowledge. It took me some time to get the combination exactly right. The procedure most talked about doesn’t work in most mobiles or is only for rooted mobiles, but this works everywhere.

Leave a Reply

RSS Relaso @ FB