Wireless Debugging in Android Studio: A Step-by-Step Guide

Wireless Debugging in Android Studio: A Step-by-Step Guide

22 April 2024 Stephan Petzl Leave a comment Tech-Help

For Android developers, the ability to use Android Debug Bridge (ADB) over a wireless connection can be extremely useful, especially when dealing with devices where the USB port is occupied or unavailable. This article provides a comprehensive guide on how to set up and use ADB over TCP/IP for wireless debugging in Android Studio.

Enabling ADB over TCP/IP

To start with wireless debugging, you need to enable ADB over TCP/IP on your device. Follow these steps:

  1. Connect your Android device to your computer via USB.
  2. Open a terminal or command prompt on your computer.
  3. Execute the following command to restart ADB in TCP mode on port 5555:
  4. adb tcpip 5555
  5. Disconnect your device from USB.

Finding the IP Address of Your Device

Before connecting to your device wirelessly, you need to know its IP address:

  • For devices prior to Android Oreo, navigate to Settings > About tablet > Status > IP address.
  • For devices running Android Oreo or later, go to Settings > Wi-Fi > <Your network> > IP address.

Connecting to Your Device Wirelessly

Once you have the IP address, you can connect your development machine to your device:

  1. Open a terminal or command prompt on your computer.
  2. Run the following command, replacing #.#.#.# with your device’s IP address:
  3. adb connect #.#.#.#

After running this command, your device should be connected to Android Studio wirelessly, allowing you to see the logcat and install your application without a USB cable.

Creating a One-Click Wireless Connection in Android Studio

You can streamline the process of connecting to your device wirelessly by setting up an external tool in Android Studio:

  1. Go to File > Settings > Tools > External Tools.
  2. Create a new tool with the path to your ADB executable and the necessary commands.
  3. Save the tool and access it via Tools > External Tools > Android Over Wifi.

When prompted, enter your device’s IP address to connect.

Integrating Repeato for Streamlined Testing

While setting up wireless debugging is a step towards efficient development, integrating your workflow with a robust testing tool like Repeato can further enhance your productivity. Repeato is a no-code test automation tool that supports iOS and Android, allowing you to create, run, and maintain automated tests for your apps with ease.

Repeato’s use of computer vision and AI eliminates the need for coding tests, making it a perfect match for developers who want to quickly edit and run tests on various app frameworks, such as React Native, Flutter, or Unity. Additionally, Repeato comes with ADB onboard, which means you can execute ADB commands via script steps, harmonizing with the wireless debugging setup in Android Studio.

By leveraging the wireless debugging techniques alongside Repeato’s test automation capabilities, developers can ensure a seamless and efficient development and testing cycle for their mobile applications.

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