Easily debug mobile app on physical device wirelessly

Easily debug mobile app on physical device wirelessly

In this tutorial, I'll show you how to enable & setup Android wireless debugging using command line for Android 11 or later (Android 10 and lower have a slightly different method).

Prerequisites

  • adb (Android Debug Bridge)
  • Host machine (Windows, Linux, macOS, etc.)
  • Physical Android device
  • Wifi network

You can download adb from Android Studio or as standalone installations. Make sure the path to the adb executables is added to PATH. For example, if you're on Windows, adb is located in the C:\Users\<User>\AppData\Local\Android\Sdk\platform-tools\adb.exe.

You can check is adb is ready by running the command adb --version.

check abd is installed

Please enable the Developer Options first if you haven't done so. See this guide.

Both host machine and Android device need to be on the same Wifi network.

warning

Some public/university wifi networks have restrictions and can't be used for wireless debugging.

Pairing

On your Android device. Go to Settings > Developer Options. Scroll down and tap on Wireless Debugging section.

Setting Wireless Debugging

Tap on Pair Device with Pairing Code.

Wireless Debugging pair

Open Terminal on the host machine. Enter the the following command (Replace IPADDRESS & PORT with the IP address & Port shown on the Android device):

adb pair IPADDRESS:PORT
Host machine ADB Pair

After successful pairing, the host machine will appear in the list of paired devices.

Android ADB Paired

Connect to the device

Whenever you want to connect to the device, you can use the following command (Replace IPADDRESS & PORT with the IP address & Port shown on the Android device):

adb connect IPADDRESS:PORT
Android Ip & port to connect
tip

Check devices connected to ADB by running adb devices.

Terminal 3

That's it! Now you can debug your app on your Android device. Happy hacking!