Connecting to Android Devices Over Wi-Fi in Android Studio

Connecting to Android Devices Over Wi-Fi in Android Studio

30 November 2024 Stephan Petzl Leave a comment Tech-Help

Developers often encounter situations where using a USB cable for Android debugging is impractical or impossible. Fortunately, Android Studio offers the ability to connect to devices wirelessly using ADB over TCP/IP, which can be particularly useful when the USB port is occupied or unavailable. This guide will walk you through the steps required to set up ADB over Wi-Fi.

Step-by-Step Guide

1. Enable Wireless Debugging

To begin, ensure your Android device is connected to the same Wi-Fi network as your development machine. Then, follow these steps:

  • Open a terminal or command prompt on your computer.
  • Execute the command: adb tcpip 5555. This command restarts ADB in TCP mode, listening on port 5555.

2. Obtain the Device’s IP Address

Before connecting, you’ll need to know your device’s IP address. The method to find this varies slightly depending on your Android version:

  • For devices running Android Oreo and above, navigate to: Settings > Wi-Fi > Network > IP address.
  • For older versions, go to: Settings > About Tablet/Phone > Status > IP address.

3. Connect to the Device

Once you have the IP address, you can connect using the following command:

  • In your terminal or command prompt, type: adb connect [device_ip_address]. For example, adb connect 192.168.1.100.

Your device should now be connected wirelessly, allowing you to view logcat output and deploy applications directly from Android Studio.

Troubleshooting

If you encounter connectivity issues, ensure:

  • Your device and computer are on the same network.
  • ADB is updated to the latest version.
  • No firewall settings are blocking the connection.

Enhancing Your Workflow with Repeato

For developers seeking a streamlined testing process, Repeato offers a no-code test automation solution for iOS and Android applications. With its ability to run and maintain automated tests quickly, Repeato leverages computer vision and AI to enhance your testing capabilities.

Repeato also simplifies the execution of ADB commands through its “script steps” feature, allowing precise timing and sequencing of commands. This can be particularly beneficial when setting up or troubleshooting wireless connections, as described in this guide.

For more information on how Repeato can integrate with your development process, visit our documentation section.

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