Ever had times when you wanted to test an app and you didn’t have a USB cord handy? Well I was in that situation 2 weeks ago when my USB got destroyed by a car door.
I always test my Android apps using a device. My laptop has very low RAM and using the emulator has never been an option for me. So when I mentioned my predicament to a colleague at work he passively said something like “there’s something like wireless debugging…“, and I Googled it out. I got a solution and here it is.
- Have a USB cord handy for initial set up.
- Connect your device and computer to the same Wi-Fi network.
- Note your device’s IP address. You can do this by going to Settings on your device, look for About Phone and open Status. There are several items displayed as status and IP address is among them.
- Optionally add the path to platform-tools to system path.
- Open a terminal window.
- Connect your android device to your computer via USB for initial setup.
- Execute the following commands:
a. List all connected devices
You’ll see your USB connected device listed
b. Turn on Wi-Fi debug mode
adb tcpip 1111
c. Connect to device
adb connect 192.168.8.103:1111
If you’re disconnected just open a terminal window and type
adb connect [ip-address:port] using the device’s new IP address (if it has changed).