Setting Up ADB for Wireless Connection to Android Devices

Setting Up ADB for Wireless Connection to Android Devices

22 April 2024 Stephan Petzl Leave a comment Tech-Help

Wireless debugging is a convenient feature for Android developers, allowing you to deploy and debug your applications without the need for a physical USB connection between your development machine and Android device. This guide will walk you through the process of setting up ADB (Android Debug Bridge) for a wireless connection.

Prerequisites

  • Android device with Developer Options enabled
  • ADB installed on your development machine
  • Both your development machine and Android device connected to the same Wi-Fi network

Enabling ADB Over Wi-Fi

To start with, connect your Android device to your development machine via a USB cable. Then, follow these steps:

  1. Enable USB debugging on your Android device by going to Settings > Developer Options > and toggle on USB debugging.
  2. Open a terminal or command prompt on your development machine and type the following command to restart ADB in TCP mode on port 5555:

    adb tcpip 5555
  3. Find the wireless IP address of your device. This can typically be found in Settings > About phone > Status or Wi-Fi settings. Alternatively, you can use the command:

    adb shell ip route to find the IP address.
  4. Connect to your device over Wi-Fi by typing the following command, replacing 192.168.1.133 with your device’s IP address:

    adb connect 192.168.1.133

After executing these steps, you should be able to deploy and debug your applications wirelessly. You can verify the connection by running adb devices, which should list your device.

Reverting to USB Mode

If you need to switch back to USB mode, simply run the command adb usb. Some devices may also revert back to USB mode after a reboot.

Wireless ADB on Android 11 and Later

Starting with Android 11, the process has been further simplified with a built-in wireless debugging feature. Here’s how to use it:

  1. Go to Developer Options and find Wireless debugging.
  2. Toggle on Wireless debugging and select Pair device with pairing code.
  3. Note the IP address and port, as well as the pairing code displayed.
  4. On your development machine, run the command adb pair [IP address and port] and enter the pairing code when prompted.
  5. After pairing, connect to your device with adb connect [IP address].

Once again, you can confirm the connection with adb devices.

Integrating with Repeato

For those utilizing automated testing, Repeato can enhance your workflow. This no-code test automation tool supports iOS and Android applications, including those built with frameworks like React Native, Flutter, and Unity. Repeato’s fast editing and execution of automated tests, along with its AI and computer vision capabilities, make it an invaluable asset in ensuring application quality.

Moreover, Repeato comes with ADB onboard, allowing you to execute ADB commands directly within your automated test scripts. This seamless integration can simplify the process of connecting to devices wirelessly, especially when managing multiple devices for testing purposes.

Conclusion

Wireless ADB provides a flexible and efficient way to develop and test Android applications. By following the steps outlined above, you can set up a wireless connection between your development machine and Android device without the need for root access. For an even more streamlined testing process, consider incorporating Repeato into your workflow for its robust no-code test automation capabilities.

For more detailed guides on using ADB and setting up your testing environment, visit our blog articles on Launching Android Applications via ADB and Managing ADB Shell with Multiple Connected Devices.

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