ADB Pairing Failed? Fix Wrong Pairing Code and adb pair Errors
Fix Wireless debugging pairing that fails, a wrong or expired pairing code, a pairing dialog that closes when you switch apps, and adb pair protocol fault errors.
Wireless debugging pairing fails for four main reasons: the six-digit code expired or was mistyped, the "Pair device with pairing code" dialog closed before pairing finished, you used the wrong port (the connect port instead of the pairing port), or the two sides cannot reach each other on the network. Open the pairing dialog again, keep it on screen, and pair with the new code and the port shown in that dialog. The details for each case are below.
How pairing works (30 seconds)
When you tap Pair device with pairing code, the phone starts a short-lived pairing service on its own port and shows:
- a six-digit Wi-Fi pairing code, and
- an IP address & Port for pairing.
That service only exists while the dialog is open. Close the dialog, leave Developer options, or wait too long, and it is gone. The code shown is only good for that one dialog.
After pairing, you connect to a different port, the one at the top of the Wireless debugging screen. Mixing up the two ports is the most common PC mistake.
Error by error
| Message | Meaning | Fix |
|---|---|---|
Failed: Wrong password or connection was dropped. | Wrong or old code, or the dialog closed | Open the dialog again, use the new code at once |
error: protocol fault (couldn't read status message) | Pairing did not complete, often wrong port or closed dialog | Use the port shown in the pairing dialog, keep it open |
failed to connect ... Connection refused | Nothing listens on that port | You used the connect port, or the dialog closed |
failed to connect ... timed out | Network cannot reach the phone | Same Wi-Fi, no guest network, no VPN |
Failed: Unable to start pairing client. | Old or broken adb on the PC | Update platform-tools, adb kill-server |
Pairing succeeds but adb devices is empty | You did not connect yet | adb connect with the main port |
Fix 1: the code is wrong or expired
- Type the code from the dialog that is open right now. Each new dialog shows a new code.
- Pair within a minute or so. Long waits often fail.
- Check for look-alike digits: 1 and 7, 6 and 8, 0 and 9 on small fonts.
Fix 2: the dialog closes when you switch apps
This catches almost everyone who tries to pair an app on the same phone. Android closes "Pair device with pairing code" as soon as you leave Developer options, so by the time you open the other app to type the code, the pairing service is already gone.
Three ways around it:
- Type the code into a notification. Apps that support it post a notification with a reply box, so you type without leaving the dialog. This is how ADB Kit does it (below).
- Split screen. Put Settings in one half and the app in the other, then open the pairing dialog in the Settings half. On most phones: open Recents, tap the app icon at the top of its card, and choose Split screen. Some phones use a long press on the card.
- Pop-up / floating window. Many Xiaomi, OPPO, vivo and Samsung phones can open an app in a small window over Settings.
Fix 3: wrong port on a computer
On a PC, pair with the port from the pairing dialog, then connect with the port from the main Wireless debugging screen:
adb pair 192.168.1.20:37011 # port from the "Pair device with pairing code" dialog
adb connect 192.168.1.20:41237 # port from the top of the Wireless debugging screen
adb devicesIf you see Connection refused on adb pair, the pairing dialog has closed or you used the connect port.
Fix 4: the network blocks it
- Phone and computer must be on the same Wi-Fi. Guest networks and office networks often isolate devices.
- Pause VPN apps on both sides.
- Some routers block the multicast (mDNS) that tools use to find the phone. Typing the IP and port by hand still works.
- On a Mac, allow Local Network access for your terminal or Android Studio in System Settings › Privacy & Security.
Fix 5: update adb and restart it
Old platform-tools pair badly or report success when pairing failed. Use a recent version and restart the server:
adb version
adb kill-server
adb start-serveradb pair needs platform-tools 30 or newer.
Pairing with ADB Kit (no PC)
ADB Kit pairs the phone with itself and avoids the closing-dialog problem:
- Make sure the phone is on Wi-Fi and Wireless debugging is on. The Home tab checks this for you.
- Tap Start pairing in ADB Kit.
- In Settings, open Wireless debugging › Pair device with pairing code.
- ADB Kit finds the pairing service on the network by itself, the way Android Studio does. Its notification pops up: Code found. Enter it in the notification.
- Type the six digits into the notification's reply box. The dialog stays open the whole time.
- ADB Kit pairs and connects. You never type a port.
ADB Kit reports the two main failures separately, so you know which fix applies:
| ADB Kit message | What to do |
|---|---|
| Wrong code. Check the code and try again. | The digits did not match. Use the code on screen now |
| Pairing dialog closed. Open it again and use the new code. | The dialog was gone before pairing. Open it again |
| Pairing code not found. Keep "Pair device with pairing code" open. | ADB Kit could not see the pairing service. Keep the dialog on screen |
| The pairing code has six digits. | A digit is missing or extra |
| Connect to a Wi-Fi network first. | Join Wi-Fi or a hotspot |
If notifications are off, the app says Notifications are off: type the code below, or allow them. Tap Allow notifications, or use split screen and Type the code here instead.
Pairing another phone
To pair a second phone from ADB Kit, tap Add phone on Home. The other phone either scans a QR code (on that phone: Wireless debugging › Pair device with QR code) or shows a pairing code you type in. Both phones must be on the same Wi-Fi. If it fails with Pairing failed. Tap New code and scan again., the QR code timed out. See control an Android phone from another phone.
When pairing worked before and now fails
- You removed the device under Paired devices, or tapped Revoke USB debugging authorizations. Pair again.
- The phone was not connected for a long time and Android dropped the authorisation. Disable adb authorization timeout in Developer options prevents this on many phones.
- Wireless debugging is simply off after a restart. That needs no new pairing, see Wireless debugging keeps turning off.
Safety note
Pair only with devices and apps you trust. A paired device has the same power as a computer plugged in with USB debugging. You can remove old ones at any time under Wireless debugging › Paired devices.