How to use ADB wirelessly on Android 11 or higher

  • ADB allows you to control and debug your Android device from your computer, with access to advanced features such as app installation, shell, and file copying.
  • From Android 11 onwards you can use wireless debugging over Wi-Fi with pairing via QR code or PIN, both from Android Studio and via command line.
  • Classic ADB methods over TCP/IP are still available after an initial USB connection, in addition to advanced automations with Termux and Tasker.
  • Once connected via Wi-Fi, all the usual ADB commands (install, shell, screencap, screenrecord, forward, etc.) work just as if you were connected by cable.

How to use ADB wirelessly on Android 11 or higher

If you enjoy tinkering with your mobile phone or developing apps, ADB (Android Debug Bridge) is a basic tool for controlling the device from the computerIt allows you to do things that are impossible from the normal Android interface, such as uninstalling system bloatware, automating tasks, or accessing the phone's command shell.

Until recently, it was common to rely on a USB cable to use ADB, but since Android 11 things have changed: You can connect your mobile phone to ADB via Wi-Fi without needing to plug it into your PC.The system includes a wireless debugging option with QR codes and pairing codes that greatly simplifies the process, and the old ADB method over TCP/IP is still available after an initial USB connection.

What is ADB and why should you be interested in using it wirelessly?

ADB stands for Android Debug Bridge and acts as a bridge communication between your computer and your Android device using console commandsIt's designed for developers, but it's also pure gold for advanced users who want to go a little beyond what the graphical interface allows.

This utility consists of three parts: a client that runs on your PC, a daemon (adbd) that runs on the mobile device or emulator, and a server that coordinates both.The client sends the commands, the server distributes them, and the daemon executes them on the device. All of this happens in the background every time you type an adb command in the terminal.

With ADB you can do everything: Install and uninstall apps, debug applications, access a full Unix shell, copy files, record the screen, take screenshots, or redirect portsIt even allows you to manage permissions, user profiles, or device policies at an enterprise level.

The classic problem with ADB has always been the same: It depends on a USB cable and that the phone and PC ports are in good condition.If the phone's connector is damaged, if the cable is making poor contact, or if the USB drivers in Windows are causing problems, you can go crazy trying to get the PC to recognize the device.

Android 11 took a significant leap in this regard, introducing the so-called Wireless debugging, which allows you to link your phone to the device via Wi-Fi using a QR code or a pairing PIN codeThis way, you can forget about the cable for both development and many advanced user tasks.

Basic requirements for using wireless ADB on Android 11 or higher

Android Wireless ADB Requirements

Before you get started, you need to be clear about some minimum requirements, because Not all mobile phones or PC configurations are suitable for modern wireless debugging that Google introduced.

First, your mobile phone needs to run Android 11 or later is required to have the Wireless Debugging option in Developer OptionsIn Android 10 and earlier, ADB can also be used over Wi-Fi, but with the old method based on TCP/IP and an initial USB connection.

On the computer side, it is essential to have The updated Android SDK platform tools, either through Android Studio or by downloading the standalone package from the Google developer website.Inside that package is the adb binary that you'll use from the console. If you're working from macOS, see the guide for Connect your Android device to a Mac seamlessly..

Another essential requirement is that computer and phone are connected to the same Wi-Fi networkDo not have your PC connected via Ethernet to a corporate network and your mobile phone on the guest Wi-Fi, because in that scenario they will usually not be able to see each other or there will be filters blocking p2p traffic.

Finally, you must activate The Developer Options on your Android device, and within them, the Wireless Debugging function.Without this, the phone won't accept any ADB connections over Wi-Fi. And, importantly, when you see the notification that the device wants to be debugged over a specific network, check the box to always allow it on that network if you plan to use it regularly.

Enable developer options and wireless debugging

Enable wireless debugging on Android

The first step to forgetting about the cable is to get it Android should display advanced developer options and explicitly allow the use of ADB over Wi-Fi.The process is very similar in almost all customization layers, although the menu names change slightly.

To enable developer options, go to Settings > About phone (or Device information) and tap repeatedly on Build number or VersionAfter a few taps, the system will display a message such as "You are now a developer" or "No need, you are already a programmer." From that moment on, a new Developer Options menu will appear in the settings.

The quickest way to get there is to use the search function integrated into your phone's settings and type “Developer options” to go directly to the advanced sectionInside, you'll find the debug switches, both USB and wireless.

Scroll through the list until you see the entry Wireless debugging or debugging over WLANWhen you activate it, Android will display a pop-up window showing the parameters of the Wi-Fi network you're connected to and asking for confirmation. Check the box. Always allow on this network If you trust it, press Allow.

Right next to the Wireless Debug switch, there's usually an arrow pointing to the right; tapping it will give you access to the dedicated wireless debugging screen, where you'll see options like linking device with QR code, pairing with sync code, or linking with pairing codeThis is where we'll work to connect the mobile phone to the PC wirelessly.

Connect ADB wirelessly using Android Studio (QR code or PIN)

Pair Android Studio over Wi-Fi

If you already use Android Studio for development, it's very easy, because modern versions of the IDE (from Android Studio Bumblebee onwards) include A graphical assistant for pairing physical devices via Wi-Fi using a QR code or numeric codeYou'll hardly have to type any commands.

With the project open, go to Android Studio to Open Device Manager and then the Physical tab to view your physical devices.At the top you will find the option Pair using Wi-Fi or Pair devices using Wi-Fi depending on the version.

Clicking on that option opens a pop-up window with two tabs: Pair using QR code and Pair using pairing codeThe default tab is usually the QR code tab, where a QR code ready to be scanned is already displayed.

That QR code isn't black magic: Android Studio internally generates a Wi-Fi connection profile and pairing data that are encoded within the QR code.If you scanned it with any other reader, you would see that it is a specific configuration, but you shouldn't use third-party readers to connect the phone; the scan has to be done from the wireless debugging menu of Android itself.

On your phone, with Developer Options enabled, go to Wireless debugging and tap on Pair device with QR codeThis will open the camera in scanner mode. Focus it on the QR code that Android Studio is displaying on your computer and wait a few seconds for it to complete the pairing process.

If everything goes fine, The mobile device will be paired with your workstation without you having to type a single command.Android will remember the device as a linked device, and in Android Studio the phone will appear in the list of physical devices ready to run and debug apps.

It's possible that the QR code pairing might fail or get stuck on "pairing device...". In that case, we'll switch to the other tab: Pair using pairing code, which uses a six-digit numeric code to complete synchronizationThis method is usually more reliable when there are network problems or issues with the QR reader.

Pair wireless ADB with sync code (no QR code)

When the QR reader fails, plan B consists of Use a six-digit pairing code along with an IP address and port, which Android displays on the wireless debugging screen.

On your phone, go back to Settings > Developer options > Wireless debugging and tap the option Link with sync code or Pair device with pairing codeA window will appear with a field displaying something like 192.168.XY:PORT and a six-digit numeric code. This information is sensitive, so it's best not to share it with anyone.

While keeping this screen open on your mobile device, switch to your PC and in Android Studio, within the Wi-Fi pairing wizard, select the tab Pair using pairing code and press the Pair button to enter the codeAndroid Studio will start searching for devices waiting to be paired.

When the phone is detected, the assistant will ask you to Enter the same six-digit code you see on your Android screen into Android StudioUpon confirmation, the pairing is complete and the device becomes available for wireless installation and debugging.

Once paired, you can open the tab Terminal in Android Studio to launch adb commands as if it were a normal consoleThe only difference is that, if you haven't added platform-tools to the PATH environment variable, you'll have to manually navigate to the folder where the adb binary is located (for example, %LOCALAPPDATA%\Android\SDK\platform-tools on Windows).

Keep in mind that, even if the pairing persists, The wireless connection may be interrupted if the device changes Wi-Fi networks, loses signal, or the router blocks P2P connections.In those cases, simply reconnect the device from Android Studio or repeat the pairing process if it has been forgotten.

Using ADB without Android Studio: Command line and manual pairing

If you prefer to use the terminal directly, or if your PC doesn't handle Android Studio well, you can also... Use Android 11+ wireless debugging directly from the command line with `adb pair` and `adb connect`It's perfect for Windows, macOS, or Linux without an IDE.

After enabling Wireless Debugging on your mobile device, enter that same menu and tap Link device with synchronization codeYou'll see the IP address and pairing port, as well as the famous six-digit code. Leave it on the screen.

On your computer, open a terminal and navigate to the folder where you have adb, usually android_sdk/platform-tools or C:\Users\YOUR_USER\AppData\Local\Android\Sdk\platform-tools on WindowsIf you want to avoid writing that path every time, you can add it to the system's Path variable later.

Now run the following command in the console adb pair ip:port, replacing ip:port with what your mobile shows you, for example adb pair 192.168.1.23:37119. The program will then ask you to enter the six-digit pairing code.

If the code is correct and the network is properly configured, The device will be paired, but one thing is still missing: the actual ADB connection that will be used to install and debug apps.On the same Android Wireless Debugging screen, near the top, you will see another IP address:port, associated with your device name.

That second IP address with port is the key: You must use it with the command `adb connect ip:port` to establish the active ADB connectionFor example, adb connect 192.168.1.23:5555. If everything is okay, the device will appear in the adb devices list as “device”.

Don't be surprised if, every time you want to reconnect from scratch, you have to Repeat the process of pairing with code and then do adb connect using the new IP:portIn many cases, even if Android shows that the computer is already paired, it is advisable to repeat the code generation steps to avoid mDNS discovery errors.

Configure the ADB path in Windows for easier use

Working with ADB becomes cumbersome if you have to Type the full path to platform-tools or cd to the folder every time you open the command promptThe ideal solution is to add that folder to the Windows Path environment variable.

In Windows 10 or 11, use the Start menu search to access “Edit system environment variables” or “Edit environment variables for your account”A window will open with two sections: User Variables and System Variables.

At the top, under User Variables, select Path and press Edit > New to add an entry with the full path to the platform-tools folderFor example, C:\Users\your_username\AppData\Local\Android\Sdk\platform-tools. Accept all dialog boxes to save changes.

From that moment on, if you open a new command prompt or PowerShell window, you will be able to Run adb commands from any path without needing to specify the folderThis is especially convenient when you're writing scripts or combining adb with other tools.

To verify that everything is correct, simply type adb devices and verify that the system recognizes the binary and lists the connected devices (either via USB or Wi-Fi). If you get an "unrecognized command" error, check that the path is spelled correctly and that you opened a new console window after changing the path.

Classic method: ADB over Wi-Fi after an initial USB connection (Android 10 and earlier)

Although Android 11 and higher versions have their own wireless pairing system, The old trick of enabling ADB via TCP/IP on port 5555 is still perfectly validIt's the only pure Wi-Fi option on Android 10 and earlier, and it also works on Android 11+ if you prefer this approach.

The procedure is simple: first, make sure that PC and mobile share the same Wi-Fi network and connect the phone to the computer using a USB cableEnable USB debugging in Developer Options and accept the computer's RSA key when the dialog box appears.

From your computer's terminal, use Run `adb devices` to verify that the device appears as "device" and that the USB connection is working.If it is not listed or appears as offline, you will need to check the drivers, cable or port.

When the phone responds correctly, execute the command `adb ​​tcpip 5555` to tell adbd to start listening for TCP connections on port 5555If the command is successful, you can now disconnect the USB cable from the mobile phone.

On your phone, go to Settings > About phone > Status > IP address (or the specific Wi-Fi section) and note the Internal IP address of the device, in the style 192.168.xxNext, in the computer console, use adb connect ip_address:5555, for example adb connect 192.168.1.50:5555.

If everything is correct, `adb ​​devices` will now show the IP address: 5555 as a "device" and you'll have ADB active over Wi-Fi even on older versions of Android.Keep in mind, though, that if you change networks or restart your phone, you'll probably have to repeat the USB + tcpip process.

Automate ADB over Wi-Fi on your mobile device using Termux and Tasker

For very advanced users who want to take things to the next level, there is the option to Automate ADB activation over Wi-Fi directly from your phone using Termux and Taskerso that every time the mobile phone starts up, the wireless debugging server is activated.

The general idea involves installing Termux (best from F-Droid because it has an updated repository), the Termux:Tasker plugin, and the Tasker appWithin Termux, the android-tools package is added with pkg install android-tools to have the adb binary available on the phone itself.

Then the folder structure is created in Termux .termux/tasker and inside you write scripts like adb.sh and adb_pair.shwhich accept host and code parameters and execute commands such as adb connect, adb tcpip 5555, adb pair or adb kill-server directly in the Termux environment.

On Android, Tasker needs to be granted the special permission of "Execute commands in the Termux environment" so that you can launch those scripts when certain conditions are met.Once done, Tasker profiles are imported that activate Wi-Fi ADB when the mobile is unlocked, obtain the debug port via Logcat logs, and connect automatically.

Typical profiles include one that It initializes a state variable when the device starts, another that enables WLAN debugging after a certain boot time, and a third that analyzes the logs, extracts the port, and calls the Termux scripts to connect and switch to tcpip 5555Although it's more of a geeky than practical solution for most, it demonstrates the potential of wireless debugging.

For initial pairing by code, a Tasker profile can be configured that, when you hold down volume up while the pair device with code window is on screen, Automatically send Termux the IP address, port, and code to run adb pair from the phone itself.Once paired, the profile is deactivated because it is no longer necessary to repeat it constantly.

Main ADB commands useful when working over Wi-Fi

Once the connection is established, the full power of ADB is available just as if you were plugged in via USB, so it's good to be clear on Some of the most common commands to take advantage of wireless debugging.

To see which devices are connected, the base command is `adb ​​devices -l` lists each instance with its serial number, status, and a brief description.If the device is in wireless mode, it will usually appear with its IP address:port.

If you have multiple devices at once, physical or emulators, you can direct commands to a specific one with adb -s serial_number command, or set the ANDROID_SERIAL environment variableThere are also the shortcuts -d for "the only physical device" and -e for "the only emulator" when there is only one of each type.

To install an app from an APK you will use adb install path_to_apk, or adb install-multiple if it's several split APKsWhen uninstalling, `adb uninstall package.name` removes the app, with the `-k` option to preserve user data.

Regarding file manipulation, you have `adb ​​push archivo_local ruta_remota` to send files to the mobile device and `adb pull ruta_remota carpeta_local` to bring them to the computerIt is very useful when combined with screenshots or log records.

To access the device's system, there's the classic adb shell, which opens an interactive shell on the mobile device with Unix-like toolsFrom there you can launch am (Activity Manager) to start activities, services or send intents, and pm (Package Manager) to list, enable or disable packages and permissions.

Advanced features: screenshots, screen recording, and other utilities

ADB is not limited to installing and uninstalling apps; it also facilitates a number of very powerful support tasks that They make even more sense when you can use them without having your phone tethered to your computer by a cable..

To take a screenshot, the basic command is adb shell screencap /sdcard/screen.png and then adb pull /sdcard/screen.png to bring it to the PCYou can also use `adb exec-out screencap -p > screen.png` to save it directly to your local machine in one go.

If you want to record video, you have the tool `adb ​​shell screenrecord /sdcard/demo.mp4`, which will capture the device screen in an MP4 file up to 3 minutes by default.When finished, you download it with `adb pull`. Screenrecord allows you to adjust resolution, bitrate, and maximum time with parameters such as `--size`, `--bit-rate`, or `--time-limit`.

Another very powerful function is the port forwarding with adb forward tcp:host_port tcp:device_port or to special destinations such as local:logdwhich is great for debugging internal mobile services, testing local APIs, or inspecting traffic.

If at any point ADB starts behaving strangely, becomes unresponsive, or stops seeing devices, you can Restart the server with `adb kill-server` and then implicitly relaunch it when executing any adb command.This solves many specific problems without needing to touch anything else.

Finally, for very intensive developments, you might be interested in the ADB 36.0.0's burst mode, which is activated with the environment variable ADB_BURST_MODE=1 or from the Android Studio settingsIt improves performance in large transfers and reduces latency by allowing ADB to send packets without waiting as long for each response.

Between the wireless debugging built into Android 11 and later, pairing via QR or PIN, classic TCP/IP methods, and the entire arsenal of commands and utilities offered by the tool itself, Today you can work with your Android device from your computer in an extremely flexible way and, best of all, without depending on a cable that always seems to appear when you least need it..

How to use scrcpy from Windows to control your Android device
Related article:
How to use scrcpy from Windows to control your Android device