Android Device Wireless Debugging

From RAD Studio
Jump to: navigation, search

Go Up to Running and Debugging Your Android Application On a Remote Android Device


You can run or debug an Android application directly to a real Android device using Wireless Network. This way you don't have to connect your device to a USB port all the time. This is specially useful and easier when developing on a Virtual Machine.


To enable wireless debugging, you must make sure your device is connected to the same network with your computer, and can connect each other.

Developer Options - Wireless Debugging

Steps to pair below Android 11

  1. For an Android device prior to Android 11 version, you must first pair the device using USB connection.
    Note: To enable USB Debugging on Android, please see: Enable USB debugging on your Android device.
  2. After successfully enable USB Debugging for your Android device, perform these steps from your Android SDK platform-tools folder to pair the device:
    adb tcpip 5555
    adb connect 192.168.1.10:5555
    Note: Replace 192.168.1.10 with your device IP address.
  3. Use this command to make sure your device is connected successfully:
    adb devices
    Note: It will show your device IP address and Port with the connection state. It should be showing device if connected.
  4. You can unplug the USB connection

Steps to pair Android 11 and above

As of Android 11 version, you can directly pair an Android device over a wireless network without using USB connection. Before you can pair the device, you need to make sure a few things as the requirement:

  1. Android device running Android 11 or newer
  2. SDK Platform-Tools version 30.0.0 or newer

On your Android device:

  1. Go to Device Settings | Developer Options
  2. Find the Wireless Debugging option
  3. Set to enable, it will show a confirmation dialog to allow debugging on current wireless network, click allow to enable it
  4. Click the Wireless Debugging option, this will bring Wireless Debugging Configuration
  5. Click Pair Device with pairing code, this will show a wifi Pairing Code with device ip address and port to be used by the pc to pair

On your computer:

  1. open the Android SDK platform-tools folder
  2. Run this command:
    adb pair 192.168.1.10:47539
    Note: Replace 192.168.1.10 with your device IP address and 47539 with your device port as mentioned in step 5 above. You will be prompted for a Pairing Code, enter the Pairing Code mentioned in the step 5 above.
    adb connect 192.168.1.10:47539
    Note: Replace 192.168.1.10 with your device IP address and 47539 with your device port as mention in step 5 above.
  3. Use this command to make sure your device is connected successfully:
    adb devices
    Note: It will show your device IP address and Port with the connection state. It should be showing device if connected.

After you successfully connected the device, you can see the list of your connected device in the Delphi IDE Android Device List, then you can directly run or debug your project to the device from the IDE.

See Also