Mac pairing for Apple TV box for use with Xcode relies on the home network connection, not a physical wired connection between the two devices: no port needed, Wi-Fi is fine. Verify that the Mac uses the latest version of Xcode (v14.3.1 as of now). Older versions Xcode may not have support for tvOS 16.5.
The last few tvOS updates were quite finicky for me. It lost the pairing each time, and took several tries to get it working again. The trick seems to be to have the right screen open on both devices at the same time (②,③).
Pair your Mac to your Apple TV
If you’re a developer, you can pair your Mac to your Apple TV so you can use developer features and record screenshots or capture video on Apple TV. Here's how:
1. Make sure that your Mac and Apple TV are on the same Wi-Fi network.
2. On your Mac, open Xcode and choose Window > Devices and Simulators.
3. On your Apple TV, go to Settings > Remotes and Devices > Remote App and Devices.
4. In the Xcode device manager, select your Apple TV.
5. Enter the six-digit pin that appears on the Apple TV on your Mac.
Your Apple TV is now paired with your Mac. To unpair your Mac, open Xcode > Device Manager, select your Apple TV, then choose Unpair.
Regular use of the Apple TV box doesn’t require Mac pairing. Not for AirPlay, Home Sharing, not resetting or restoring, nor other regular use functions. Xcode and a developer account does bring a few developer functions to Apple TV: Screenshots of non-DRM content, playback HUD (stream information overlay), and of course actual app development for this device.