18

I am trying to connect to my phone wirelessly for USB Debugging using following :

adb pair 192.168.30.27:41424 .

But I am getting following error:

"Unknown command pair" error.

I have already updated Android SDK Platform tools to 31+ version, still this does not fix this issue.

NeeK
  • 662
  • 1
  • 8
  • 21

6 Answers6

7

Prior to Android 11, the command to connect ADB over WiFi was:

adb connect 192.168.30.27

Not pair.
Also, no code was needed.

Note, that you must first connect your device over USB and run:

adb tcpip 5555

To turn ADB over WiFi on.

Note, that to use the new pair command, your device must it self be running Android 11+, if it has an older OS, the SDK version on your PC will not matter.

Lev M.
  • 6,088
  • 1
  • 10
  • 23
  • 1
    I am aware of this and this requires usb cable at least 1 time. For me uninstalling/installing platform tools helped fix the problem. – NeeK May 23 '21 at 04:45
6

I had similar issues. Uninstalling and installing Android SDK Platform-Tools solved the problem. Please make sure that the "Android SDK Platform-Tools" version is at least 30 or above.

Vikas Seth
  • 76
  • 2
  • 1
    This helped me fix problem. – NeeK May 23 '21 at 04:43
  • I have `Android Debug Bridge version 1.0.32` where can I see if it is below or higher than version 30? – Radon8472 Dec 31 '21 at 10:32
  • i have 1.0.40 but still not working – famfamfam Jan 04 '22 at 03:38
  • @famfamfam Check if your CLI is pointing to the right adb with `which adb` or `where adb` to see where its pointing. – Kamran Ahmed Feb 02 '22 at 13:04
  • The question is about wireless debugging. I interpret that it's also includes the connection part, i mean, not needing the cable even for that. Other answers (currently less voted than this) address possible solutions better than this one. – Dan Maia May 23 '23 at 22:44
3

If you updated recently then even though the update is on your system, you might have an older version of the adb server running. So try:

adb kill-server

and then adb pair again. Found this here: ADB pair unknown command using r32 platform tools

For me, adb pair still didn't work but the "pair devices over wifi" option in Android Studio did, after running that kill-server command.

Tyler
  • 21,762
  • 11
  • 61
  • 90
1

Check your adb version using adb --version

With Android Debug Bridge version 1.0.40 you get this error.
With Android Debug Bridge version 1.0.41, adb pair works!

Update adb via Android Studio
(https://developer.android.com/studio/intro/update)

kris
  • 11,868
  • 9
  • 88
  • 110
1

I see this when running adb version:

Android Debug Bridge version 1.0.41                                                                                     Version 29.0.6-debian                                                                                                   Installed as /usr/lib/android-sdk/platform-tools/adb      

but still getting adb: unknown command pair when running adb pair

reactor
  • 1,722
  • 1
  • 14
  • 34
1

There are two version for adb: the SDK platform tools version and the ADB version.

For my debian bullseye:

~ $ adb version
Android Debug Bridge version 1.0.41
Version 28.0.2-debian

The second one should be the sdk version.

In google's SDK release note, the wifi pairing feature is published in v30.0.0.

Debian's adb is in sdk version 28, so it does not support wireless pair.

platform tools binary from google

However, I do not know that what does the adb's own version meaning, but it seem to be stand alone with sdk version.

I download the google's platform tools binary, and it show a different sdk version but a same adb version:

~/Downloads/platform-tools $ ./adb version
Android Debug Bridge version 1.0.41
Version 34.0.1-9680074

Therefore, it need a newer sdk version to use the pair command.

gholk
  • 41
  • 4