How to fix "adb pair" error: unknown host service

Problem:

While trying to adb pair to your device, you see an error message like

$ adb pair 10.9.1.104:34879
Enter pairing code: 232521
error: unknown host service

and the pairing fails

Solution

You are not running the (correct version?) of the ADB server.

Run

adb kill-server

and then retry your adb pair command.

If that doesn’t work, reboot your device.