Wireless Android Debugging: Connecting to Android Studio via Wi-Fi

Mobile app development constantly demands high iteration speed, and using a USB cable often becomes a bottleneck. A physical connection limits the developer's mobility, takes up motherboard ports, and can create unnecessary clutter on the desktop. Switching to wireless operation significantly improves workstation ergonomics and allows for testing applications in more natural device conditions.

Modern versions Android Debug Bridge (ADB) allow you to easily configure a TCP/IP connection, making debugging virtually seamless. You no longer need to pull the cord every time you need to check your layout or debug an error in the logs. In this article, we'll cover in detail how to prepare the environment, configure the router, and configure the smartphone itself for stable wireless operation.

It's worth noting that successful implementation of this scheme requires both devices to be on the same local network with minimal latency. This isn't just a convenience, but a professional standard that allows you to focus on the code rather than searching for a faulty cable. Let's get started setting up the environment.

Network and Android version requirements

Before starting setup, make sure your hardware meets the minimum requirements for stable data transfer. A key factor here is not only the operating system version, but also the quality of wireless coverage in the development area. The debug protocol is sensitive to packet loss, so using a standard Wi-Fi 5 (802.11ac) or newer is highly recommended for comfortable operation.

Starting with Android 11, the connection process has become even easier thanks to the introduction of the Pairing Code feature, which allows you to pair devices without the need for an initial USB connection. However, for older system versions (Android 10 and below), you will still need to use a cable once to switch ADB mode to TCP. This is an important architectural limitation that must be taken into account when planning testing on legacy devices.

📊 What Android version is your main test device running?
Android 10 and below
Android 11
Android 12
Android 13+

Pay attention to your router settings. Some models have an AP Isolation feature that prevents devices on the same network from seeing each other. If you enable this feature, your computer simply won't be able to reach your phone, even if the IP addresses are correct. In this case, you'll need to log into your router's admin panel and disable this option for your guest or main network.

⚠️ Note: If you're using a corporate Wi-Fi network, security policies may block the ports required for ADB (5555 by default). In this case, try creating a hotspot on your smartphone or use your home router for testing.

Preparing Android Studio and SDK Tools

Make sure you have the latest versions installed Android SDK Platform-ToolsOlder versions of ADB may not support new wireless pairing methods or may experience errors at high data transfer rates. You can check the version in the terminal by entering the command adb versionIf the version is older than 30.0.0, it is recommended to update the tools via the SDK Manager.

In the development environment itself, it's also worth checking the debug settings. Open the menu File → Settings (on Windows/Linux) or Android Studio → Preferences (on macOS). In the section Appearance & Behavior → System Settings → Android Debugger Make sure the boxes that enable debugging are checked. It's also helpful to enable logging to monitor the connection process in real time.

To use wireless mode, you'll need to know the exact IP address of your device on the local network. You can find this in your phone's settings, but it's much more convenient to use the command line while the phone is still connected via USB. Enter the command:

adb shell ip addr show wlan0

You will find a line like this inet 192.168.1.XX/24This address (for example, 192.168.1.45) will be used to connect. Write it down or copy it, as you'll have to enter it manually.

Initial setup via USB (for Android 10 and below)

If your test device is running Android 10 or earlier, you'll need a one-time physical connection to switch ADB mode. Connect your phone to your computer with a cable and wait for the debugging permission prompt. Tap "Allow" and confirm the RSA key fingerprint.

Now you need to set the debug daemon to listen on TCP ports. By default, ADB operates over the USB protocol. To switch, run the following command in the terminal:

adb tcpip 5555

Once successfully completed, you'll see the message "restarting in TCP mode port: 5555." This means the daemon on the phone is now listening on port 5555. You can now physically disconnect the USB cable. The device is ready for wireless connection, but the connection hasn't yet been established.

The next step is to connect via IP address. Enter the command, substituting your IP address:

adb connect 192.168.1.XX:5555

If everything went well, the console will display the message "connected to 192.168.1.XX:5555." Android Studio now sees your device as if it were connected via cable. You can launch apps, take screenshots, and view logs.

☑️ Checking the USB connection

Completed: 0 / 5

Wireless pairing on Android 11 and later

Starting with the eleventh version of the operating system, Google introduced the Pairing Code mechanism, which completely eliminates the need for a USB cable for initial setup. This is especially convenient if you don't have a suitable cable handy or your phone's port is damaged. The process is now more secure and requires code confirmation on both devices.

First, enable wireless debugging mode in the developer menu. The path to the settings may vary depending on the manufacturer's shell, but it's usually located at Settings → System → Developer options → Wi-Fi debuggingTurn on this toggle switch.

Once enabled, you'll see the IP address and port assigned to the device (e.g., 192.168.1.45:39421). Click "Pair device with code." A six-digit code and a timer will appear. Quickly enter the following command on your computer:

adb pair 192.168.1.45:39421

The system will prompt you to enter a code. Enter the numbers displayed on the phone screen. After successful pairing, return to the previous menu, where the new debug port will now be displayed (usually different from the pairing port). Use the command adb connect with a new port to establish a connection.

⚠️ Please note: The pairing code is valid for a limited time. If you miss the command, you'll have to start the process over again. Make sure the watch on your computer and phone are synced, otherwise you may encounter certificate errors.

Setting up a project in Android Studio

Once ADB has successfully connected to the device, you need to ensure that the development environment itself has picked up this change. Open your project and click the button Run (green triangle). Your phone should appear in the list of available devices (Device Selector), indicating its model and "wireless" status.

If the device is not displayed, try restarting the ADB server through the menu Tools → Device Manager or by team adb kill-server And adb start-serverSometimes the device list cache in the IDE can get stuck, especially if you frequently switch between different gadgets.

For ease of use, it's helpful to set up filters in the Logcat window. Since a wireless connection can add a slight delay, filtering by your application's tags (package:name) will help you avoid missing important error messages in the system log stream. It's also recommended to enable the "Show only selected application" option.

What to do if the connection timed out?

If you receive a timeout error when connecting, check your firewall. On Windows, you may need to allow java.exe or adb.exe through the firewall. Also, make sure you're not using a Public Network profile, which blocks incoming connections.

Troubleshooting and Error Table

Wireless connection instability is the most common issue with this setup. The signal may be interrupted, ports may be blocked, and IP addresses may change. Below is a table of errors and solutions to help you quickly diagnose the problem.

Error / Symptom Possible cause Solution
connection refused Invalid port or ADB is not running Check the port in the Wi-Fi Debugging settings, run adb tcpip 5555
unable to connect to IP:port Devices on different networks Make sure your PC and phone are on the same Wi-Fi network (not a Guest network)
device offline ADB version conflict Update Platform Tools, restart the server adb kill-server
Timeout error Weak signal or blocked by a firewall Get closer to the router and check your antivirus settings.

To improve stability, you can increase the ADB timeout. By default, it is 5000 ms, which may be too short for congested networks. Add the line ADB_SERVER_SOCKET_PORT=5037 in environment variables or use a startup flag if your CLI version supports it. However, the best solution remains improving the Wi-Fi signal quality.

If you work in an office with multiple networks, make sure you're connected to the 5 GHz band. The 2.4 GHz band is often congested by microwave ovens and nearby routers, causing packet loss when debugging. The 5 GHz band provides a cleaner airwave and the high throughput needed for transferring APK files.

Session termination and security

After finishing work, it's important to properly end the session, especially if you're on a public network. Although the connection is encrypted, leaving ports open unnecessarily is a poor security practice. To disconnect the device, simply enter the command:

adb disconnect 192.168.1.XX:5555

Or use the command adb disconnect to terminate all active connections. If you were using tcpip mode on Android 10 or below, be sure to switch your device back to USB mode with the command adb usbThis will return the phone to its default state and close the open port 5555.

Keep in mind that while Wi-Fi debugging is enabled, any device on the same network that knows your IP address can theoretically attempt to connect. On trusted home networks, the risk is minimal, but in cafes or coworking spaces, it's best to completely disable wireless debugging in the developer settings immediately after use.

Is it possible to debug an application over the internet while in another country?

Technically, this is possible, but extremely difficult and unsafe. You'll need to forward ports on your router and know your public IP address. However, ADB traffic isn't password-protected by default (except for Android 11+), so transmitting data over the open internet without a VPN tunnel is strictly not recommended.

Why can't Android Studio see the device over Wi-Fi, even though adb connect was successful?

This is often an IDE cache issue. Try clicking the "Sync Project with Gradle Files" button or restarting Android Studio. Also, make sure the correct device is selected in the Run/Debug Configurations settings (Target Device) and not the "Open Select Device Dialog" option if the window doesn't pop up.

Does wireless debugging affect compilation speed?

The compilation itself occurs on the computer, so CPU speed remains unchanged. However, the APK installation time (install task) may increase by 2-5 seconds depending on the app size and Wi-Fi speed. For heavy games with large assets, the difference may be more noticeable.