How To Debug Your Android App over WiFi

How To Debug Your Android App over WiFi

Hello guys, its been a while since I wrote an article about code here. I have been pre – occupied at my new workplace, but still, there are more things to come. Keep subscribing 🙂

Now, I wanted to write about wireless debugging in Android. Its a little trick I discovered a while ago and it was immensely helpful. So far, whenever I was working on my Android apps, I had to connect it to my laptop with a USB cable. The USB cable is annoying and limits my movements. Then after some digging, I found out this easy work around.

All you need is a USB cable (for the initial setup) and have both devices in the same network. The screenshots in the following section are from my MacBook Pro, but it works on any operating system.

Steps

You need to connect your device to your computer via USB cable. Make sure USB debugging is working. You can check if it shows up when running adb devices.

Run adb tcpip 5555

Disconnect your device (remove the USB cable).

Go to the Settings -> About phone -> Status to view the IP address of your phone.

Run adb connect <IP address of your device>:5555

If you run adb devices again, you should see your device.

Now you can execute adb commands or use your favorite IDE (Android Studio) for android development – wireless!

Now you might ask, what do I have to do when I move into a different work space and change WiFi networks? You do not have to repeat steps 1 to 3 (these set your phone into WiFi-debug mode). You do have to connect to your phone again by executing steps 4 to 6.

Unfortunately, the android phones lose the WiFi-debug mode when restarting. Thus, if your battery died, you have to start over. Otherwise, if you keep an eye on your battery and do not restart your phone, you can live without a cable for weeks!

Happy Wireless Coding!

4 Replies to “How To Debug Your Android App over WiFi”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.