Using ADB on WiFi for Android Development

Aditya Purwa
Jul 21, 2017 · 3 min read

I used to struggle a lot when developing an Android application, mostly because the emulator is slow, and when using real device for development, the USB cable needed to connect my phone with my laptop is just as annoying as the slow emulator.

Luckily, ADB supported WiFi to connect the debug bridge between my phone and my laptop. Since then, I only used USB cable for setting up the ADB WiFi connection. Though most of the time I still enjoy using emulator because and the emulator has been made faster.

Setting Up the ADB to Connect Over WiFi

First, you have to connect your phone with your computer using aa USB cable. Make sure that the ADB detected your phone. If not, you might need to update the driver that connects your phone and your computer.

Second, open up a command prompt and navigate to your Android SDK location (on Windows you can find it inside your user folder if you install it on the default location e.g: C:\Users\YOUR-USERNAME\AppData\Local\Android\sdk\platform-tools). You probably want to add this path to your $PATH variable.

Type android devices -l to see list of the connected device. You should see your phone on the list.

You should see your phone on the list of devices attached.

Then type adb tcpip 5555 to run the ADB in TCP mode. The number after tcpip is the port you want to attach the ADB server on your phone. I use 5555 because it is easy to remember and no apps should be using that port.

You should see that the ADB server is restarting in TCP mode.

You can now plug off the USB cable from your phone and computer, and then connect to your phone via WiFi by typing adb connect <your-phone-ip>:5555 or any port you set the server to be running on, and try running adb devices -l again to check if the ADB TCP server is working correctly.

After you connected to the ADB via WiFi, you should be able to see your phone on the devices list even when the USB is detached.

Everything should be set, if you press the Run or Debug button on Android Studio, you should see your device on the list of available devices to run your app on.

Say goodbye to USB cables and broken USB port on your phone.

Myriatek

Web and Android Development Services — https://myriatek.com — This publication shares writings related to software development and things happening inside Myriatek.

)

Aditya Purwa

Written by

Software Engineer at Clearview Studios (https://kata.ai) - Software engineer, writer, designer, and artist.

Myriatek

Myriatek

Web and Android Development Services — https://myriatek.com — This publication shares writings related to software development and things happening inside Myriatek.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade