Troubleshooting ADB Connection Over Wi-Fi

Troubleshooting ADB Connection Over Wi-Fi

22 April 2024 Stephan Petzl Leave a comment Tech-Help

Connecting your Android device to the Android Debug Bridge (ADB) over Wi-Fi can be incredibly convenient for development, especially when dealing with USB-related development like Cordova plugins. However, developers occasionally encounter issues when attempting to establish this connection. This article provides a step-by-step guide to help you troubleshoot and resolve the common ADB Wi-Fi connectivity issues.

Initial Checklist

  • Ensure that your device’s Developer Options are enabled.
  • Verify that USB Debugging is turned on.
  • Confirm that your development machine and Android device are on the same Wi-Fi network.

Standard Connection Method

To begin, try the standard method for connecting to ADB over Wi-Fi:

  1. Connect your device via USB to your computer.
  2. Open a terminal or command prompt and run the following commands:
    adb usb
    adb tcpip 5555
    adb connect
  3. Disconnect the USB cable and attempt to use ADB wirelessly.

Troubleshooting Steps

If the standard method fails, follow these troubleshooting steps:

  1. Disable Aggressive Wi-Fi to Cellular handover in your device’s developer options.
  2. Ping your device from your PC to keep the network connection active, using ping -t on Windows or ping on Unix-based systems.
  3. If pinging fails, toggle Wi-Fi off and on your device and retry.
  4. When you receive responses from the ping, reconnect the device via USB and repeat the ADB connection commands.
  5. Switch the USB connection mode between MTP, PTP, and Camera while connected, and repeat the connection steps.
  6. If necessary, run ADB as an administrator or with sudo privileges.

Wireless Debugging in Android 11+

For devices running Android 11 or newer, you can use the built-in wireless debugging feature:

  1. Enable Wireless Debugging in the Developer Options.
  2. On your development machine, pair with the device using the pairing code displayed on your device by running adb pair ip:port.
  3. Finally, connect to your device over Wi-Fi by executing adb connect ip:port.

Integrating Repeato for Automated Testing

Once you’ve established a successful ADB connection over Wi-Fi, you can integrate tools like Repeato to streamline your testing process. Repeato is a no-code test automation tool that can help you create and maintain automated tests for your apps. It supports all sorts of app frameworks, works based on computer vision and AI, and even allows you to execute ADB commands via script steps, making it a versatile tool for your development and testing workflows.

For more information on ADB-related troubleshooting, check out our other articles:

Like this article? there’s more where that came from!