DEV Community

Cover image for Debugging over WiFi on a physical Android Device.
Amey Sunu
Amey Sunu

Posted on

Debugging over WiFi on a physical Android Device.

While developing and compiling Android apps, I usually use an emulator but there is this urging feel that makes me want to run my app on a physical device just to get the hang of it, so I connect my device via USB and debug on it. But at times, the cable can get really annoying, while coding. Hence I discovered a really cool way to run and debug apps on my physical device and that is via WiFi and I also figured out that you can use this same way to run a Dockerized application on a physical device.

Most of you might already know how it works and how to do it right away because it's that easy to set up and use it.

Getting Started

  • Make sure that your PC and Android device are connected to the same WiFi network.
  • Now connect your device to your PC via a USB cable and run adb devices on your terminal. You should be able to see your device in the device list.
    Make sure you have enabled USB debugging on your Android device

  • Now that your device is visible on your ADB list, run adb tcpip 5555. This will restart your ADB and switch it to the TCP you mentioned.

  • Go into your phone's WiFi settings> Advanced and then get your current device IP address.

  • Now run adb connect {your ip address}.
    Example: adb connect 192.168.1.9

  • Once you are done connecting, disconnect your device connected via USB and then run adb devices. You should be able to see your device connected via WiFi.

Voila! Now that you are connected, you can run, debug your application on your physical device connected via WiFi.

Top comments (0)