adb-pair
Pair wirelessly with an Android device
TLDR
View documentation for adb pair
SYNOPSIS
adb pair [ip address]:[port] [pairing code]
PARAMETERS
[ip address]:[port]
The IP address and port number of the Android device to pair with. The device must be listening for pairing requests on this address and port. This address and port are displayed on the target Android device.
[pairing code]
The 6-digit pairing code displayed on the Android device when it is in pairing mode. This code is essential for authenticating the connection between the computer and the device.
DESCRIPTION
The adb-pair command is a part of the Android Debug Bridge (ADB) tool, primarily used to securely connect to and debug Android devices over a Wi-Fi network. Unlike traditional USB debugging, adb-pair establishes a connection wirelessly after an initial pairing process. This process involves entering a pairing code displayed on the Android device into the command line interface. The pairing process enhances security. This command eliminates the need for a direct USB connection during development and testing, offering greater flexibility and convenience. After successful pairing, you can connect to the device using its IP address and port, facilitating wireless ADB communication. It is useful for working with devices in situations where physical access or USB connectivity is limited or unavailable.
Once paired, subsequent connections can be established using adb connect.
CAVEATS
The Android device must support wireless debugging and be in pairing mode. Both the computer and the Android device must be on the same Wi-Fi network or be able to reach each other via network routing. Firewall settings may need adjustment to allow communication on the specified port.
SECURITY CONSIDERATIONS
The pairing code is a critical component of the security model. It is essential to ensure that the pairing code is kept confidential and only entered on trusted machines. Once a device is paired, any computer with access to the pairing key could potentially connect to and debug the Android device. If you believe a device has been compromised, you can reset ADB keys on your Android device.
TROUBLESHOOTING
If pairing fails, verify that the IP address and port are correct, the pairing code is entered correctly and the Android device is discoverable. Ensure both devices are on the same network and that no firewalls are blocking communication on the specified port. Restarting the ADB server (`adb kill-server`, `adb start-server`) can sometimes resolve connectivity issues. On the device, try disabling and re-enabling wireless debugging.
HISTORY
The adb-pair command was introduced to enhance the capabilities of the Android Debug Bridge (ADB) by providing a secure method for wireless debugging. Its development addressed the growing need for flexible and convenient debugging workflows, particularly in scenarios where USB connections were impractical or unreliable. It is included with modern versions of ADB.
SEE ALSO
adb(1), adb-connect(1), adb-disconnect(1)