22 April 2024 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:
- Connect your device via USB to your computer.
- Open a terminal or command prompt and run the following commands:
adb usb adb tcpip 5555 adb connect 192.168.1.10:5555
- Disconnect the USB cable and attempt to use ADB wirelessly.
Troubleshooting Steps
If the standard method fails, follow these troubleshooting steps:
- Disable Aggressive Wi-Fi to Cellular handover in your device’s developer options.
- Ping your device from your PC to keep the network connection active, using
ping -t 192.168.1.10
on Windows orping 192.168.1.10
on Unix-based systems. - If pinging fails, toggle Wi-Fi off and on your device and retry.
- When you receive responses from the ping, reconnect the device via USB and repeat the ADB connection commands.
- Switch the USB connection mode between MTP, PTP, and Camera while connected, and repeat the connection steps.
- 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:
- Enable Wireless Debugging in the Developer Options.
- On your development machine, pair with the device using the pairing code displayed on your device by running
adb pair ip:port
. - 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:
- Troubleshooting ADB Device Unauthorized Issue
- Launching Android Applications via ADB
- Managing ADB Shell with Multiple Connected Devices
- Connecting to Android with ADB over TCP