Xcode 13.0 can't pair to Apple TV 4K (tvOS 15.0)

On Xcode 13.0, I can no longer pair with an Apple TV 4K (tvOS 15.0). Until now it has always worked but since the new update to tvOS 15.0 and Xcode 13.0 I can no longer connect.

I have gone through the following steps to connect:

  1. Open remote app and devices settings on Apple TV 4K (tvOS 15.0).
  2. Open Devices and Simulators in Xcode 13.0.
  3. Select Apple TV in the list and press "Pair".
  4. Code appears on the Apple TV and I can enter it in an Xcode window.
  5. After the code input, there is a short loading sign that a connection is being established. After a few seconds, the whole thing stops without an error message and the "Pair" button is visible again.

Does anyone have the same problem? I would like to optimize my apps for tvOS 15 and test them on a physical device.

Answered by janapple in 698735022

After changing the following setting on the Apple TV I was able to connect via Xcode:

  1. Open "AirPlay and HomeKit" under the settings on the Apple TV.
  2. Make sure "Allow Access" is set to "Anyone in the Same Network". Was on "Only People Sharing This Home" for me previously.

Since I made this change, everything works fine for me again.

Same issue. Anyone actually been able to get it loaded? I'm on MacOS 12.0 Beta (21A5248p), MacBook Pro (13-inch, M1, 2020), tvOS 14.6 Beta AppleTV 4K

Exact same problem (which actually sux as my Apple TV 4K is in the basement, and my office (MacOS) is on the 3rd floor and I've had to run up and down the stairs 3 times before the pairing failed. Would love to see an answer to this one. One slight difference, my AppleTV is currently on 14.7

I found an alternative method that worked perfectly:
https://www.youtube.com/watch?v=3U1P8e0rRyw

I'm having the same problem with an Apple TV 4K 2nd gen on tvOS 14.6 and macOS 11.4 with Xcode 12.5.1. Both are connected via ethernet to the same switch.

(My AppleTV is named "Office")

Hitting play in Xcode results in dialog "Office is not connected". Sometimes the Devices and Simulators window says "Office is locked".

I often can go into remote app and devices settings on the AppleTV, see "Office" in Xcode's Devices and Simulators, click Pair, and entering the code correctly pairs so I can run. (I didn't unpair on either end.)

But sometimes I get stuck where entering the code just shows the "Pair with Office" button again (no error). The only way I was able to break out of that cycle was to:

  1. restart my mac
  2. power off the tvos
  3. unplug and replug the tvos power cable
  4. start up xcode again and connect.

I didn't even have to pair, so maybe there's an issue with unpairing?

Regardless, building for tvOS is a really rough workflow.

I just ran into this issue. What worked for me: On the device Remote App And Device -> Remote App And Device (yes, it's listed again as a sub option of the first), selected my Mac and unpaired it. Then I Airplayed from Mac to Apple TV which showed a 4 digit code which I typed into my Mac and saw it work. (no idea if that step is required). I quit Airplay, went back to XCode which in Devices and Simulators showed a "Pair" button (wasn't there before). Paired

I have the same problem at least once or twice a week. We need to test our devices using VPNs -- it seems when the Apple TV connects to a different network than the Mac it obviously disconnects from Xcode (I really miss the USB port where we could debug no matter what network the Apple TV was on... please add that back Apple). When I reconnect my Apple TV to the same network as my Mac it is hit or miss whether it will reconnect to Xcode or not. If it doesn't, no amount of removing/ re-pairing the device works. Only solution for me is to reboot my Mac. If there is some easier way I would be delighted to hear it. Maybe there is some cache I can clear manually from the mac rather than completely disrupting my day with Mac reboots every time?

I am having the same problem with no solution so far. Has anyone found a proven solution?

I'm also having the an issue on latest AppleTV 4K and Xcode 13. Xcode's Devices and Simulators sees the device under the "discovered" list, and there is a "Pair with Living Room" button. (Living Room is the name of the AppleTV device).

When clicked, the pairing code does appear on the TV. I enter that pairing code in the Xcode Devices & Simulators pairing window. A Spinner shows for a bit, and eventually resets to show the "Pair with Living Room" button again. The device remains in the "Discovered" list, never reaching "Connected".

From the Apple TV side, the computer name does appear under the list of connected remotes and devices.

But since Xcode never completes the process, I am unable to develop or build to the device from Xcode.

I've tried removing the paired computer from the Apple TV's list of remotes and devices, re-pairing from Xcode, rebooted both machines... nothing is working. No matter what, Xcode just seems stuck in a loop where the pair never completes.

How can I fix this?

I also have this issue. Only solution I've been able to find is to first unpair the Apple TV from XCode. Then unpair the Mac from the Apple TV. Then restart BOTH. Then the pairing process will work.

This happens every time the Apple TV crashes. I'm currently investigating a memory issue in my application so crashes can be frequent while I debug what's going on. Unfortunately after every crash, XCode loses it's ability to deploy to the Apple TV and I have to run the steps above. Totally restarting the mac is very frustrating.

None of the solutions here actually solved my problem. What worked for me was to reset it to the factory settings and pairing it again.

The pairing is just really flakey.

At the moment I have to keep repairing every time I wake the Apple TV up! It's absurd. This on two ATVs. For no reason, a third ATV does not have this issue. All are latest model ATV 4Ks. Latest Xcode. New MacBook Pro 16.

Devices & Sims says the device is locked, what does that even mean for an ATV anyway? Well, the ATV is not locked as I am navigating using the remote. It's obviously visible to the MacBook and vice versa because when I go to Remote & Apps, the Pair button appears in Xcode devices + Sims.

As soon as I turn the ATV off, or it sleeps, or some period of time passes, I have to go through the rigmarole again.

Painful to dev for ATV with things like this.

I have this same problem -- Any Solutions other than resetting the apple tv back to defaults which only fixes it temporarily

So i'm noticing something.. If I uninstall Xcode, and just keep apple configurator 2 installed I am able to pair all my devices and they consistently work. That doesn't help much for development but it is making me think its something to do with Xcode.

Try rebooting your router/networking equipment. Pairing and connecting with the AppleTV happens over Bonjour/mDNS and sometimes that can get into a bad state with multiple entries for the same device.

I had gotten into the same bad state where the pairing process never completed. Tried rebooting the TV and my Mac with no help. Everything started working as expected when I restarted my router.

Toggling Wi-Fi off and then on after pairing helped in my case. Found this solution here: https://developer.apple.com/forums/thread/108459

Accepted Answer

After changing the following setting on the Apple TV I was able to connect via Xcode:

  1. Open "AirPlay and HomeKit" under the settings on the Apple TV.
  2. Make sure "Allow Access" is set to "Anyone in the Same Network". Was on "Only People Sharing This Home" for me previously.

Since I made this change, everything works fine for me again.

Similar here. Pairing the Apple TV succeeded, but since then the Devices and Simulators window says the device is locked...

For those that are still having this problem, I figured that if you remove duplicated certificates at the certificate manager it works... Tried soo many different things and this was the only fix that actually worked for me.

If it helps anyone ... one factor is, you really need a good router. Consider just rolling to bestbuy and getting a new top of line router, it's a cost of business :/

Certainly, there can be cert problems etc. But it is really much smoother with the newest possible router.

It may even sound silly but be sure to have proper modern cat8 ethernet cables for your jumpers (eg, from fiber modem or whatever to router to switch and to your appleTVs)

I've really found that pairing only works solidly if you have a really new router and everything in ideal condition. Routers are constantly slightly changing in subtleties of the specification and versions.

Just "Restart your router"

The only solution that always worked for me is to "restart the Router".

This is the fastest way to fix this issue. Apple team should look into this issue and fix it.

So I recently purchased an Apple TV and was having this same issue. I got this to work by manually downloading the latest "support file" for the version of tvOS installed, which was 15.4 (although the latest version released at the time of writing was 15.6). It connected successfully on the first attempt. I'd suggest giving this a try. Download and extract if necessary, copy extracted folder to: /Contents/Developer/Platforms/AppleTVOS.platform/DeviceSupport/. hopefully this helps

ok so been having this issue for so long and not one of the above solutions ever worked for me. then I remembered I did fix it once and now I finally remember the fix. The issue is with DNS - make sure that your apple tv and computer are on the same dns (i.e. 8.8.8.8 or better 192.168.1.1 (or whatever your router IP is), make sure its not pointing to some proxy or pihole kind of dns. After changing this, rebooting both, works like a charm.

If you have an ethernet cable plugged into your Apple TV, unplug it so the Apple TV is only communicating using Wi-Fi before attempting to pair it with Xcode.

Has anybody here seen this degrade again with Xcode 15? Xcode 14 was a pretty good year with this issue, felt like minimum issues. But with 15 it feels like it's been creeping back. If I'm in a loop of doing lots of dev and testing, sometimes I can only get a few Runs in before the Connecting between the two devices is lost. Incredibly frustrating.

Xcode 13.0 can't pair to Apple TV 4K (tvOS 15.0)
 
 
Q