I am debugging some code that requires a peripheral plugged into the phone’s USB port so I needed to be able to run adb’s logcat (and install functions) over WiFi. I found this page with the information required, the key points are repeated here for convenience.
The phone needs USB and WiFi debugging enabled in Settings->System->Developer options.
Plug the phone into the PC and enter the following on a console terminal:
adb tcpip 5555
adb connect <ip address of phone>
The phone can now be unplugged from the PC and the peripheral connected instead. As usual, to install an apk, use:
adb install -g <filename>.apk
adb logcat