Xcode and Apple TV

Has anyone figured out how to set up Xcode to write ATV apps?
It seems I can write an app for the simulator, but I get an error

And everything I can find indicates “plug the device into you mac”. Except this is an ATV, which is a network device. and it IS on the same LAN as my iMac already

It does have an USB-C port for “service and support”. I’m guessing that’s what you need to use.

You MUST have a physical connection to side load developer apps. The device also must be listed in your “Devices” section of Xcode.

I am not denying that might be the case… but surely there would be at least one website that SAID that. (I know… don;t call you shirley)

You can access Apple TV from remote, no need to do this hard wired. Open Xcode, go to Window, Devices and Simulators.

On Apple TV go to settings remotes/apps. You’ll be able to add and it will display a code on your TV and you enter on your Mac and away you go. Same goes for IOS devices for wireless access.

Then first time you try to run code it will auto register the device (presuming you have a developer account).

Easy as pie, ping me if you need an assist.

(When I say remote, I mean local network of course).

[quote=419084:@James Hankins]You can access Apple TV from remote, no need to do this hard wired. Open Xcode, go to Window, Devices and Simulators.

On Apple TV go to settings remotes/apps. You’ll be able to add and it will display a code on your TV and you enter on your Mac and away you go. Same goes for IOS devices for wireless access.

Then first time you try to run code it will auto register the device (presuming you have a developer account).

Easy as pie, ping me if you need an assist.[/quote]
Still confused.

I opened ATV, went to Settings -> Remote/Apps
Saw an entry for my iPod Touch, but no way to either add or remove anything

FYI… not any more it doesn’t

here is how to connect
https://www.redmondpie.com/how-to-wirelessly-connect-apple-tv-4k-to-xcode-on-mac/

but that doesn’t solve the “Failed to create provision profile” question :frowning:

and the last step of the above instructions… I see a spinning wheel in Xcode (Devices/Simulators screen) although my iMac now does show up on the ATV screen

On the provisioning question error, you can have Xcode manage this for you which is quite nice.

I’m presuming you have already added your developer account into the preferences for Xcode so it can login as you? If this is done, you an then select your top level Xcode project from within Xcode, then under General/Signing. Try selecting the checkbox for Automatically manage signing. Select your team.

Then when running either tethered or wireless devices for the first time it will also register your device for you.

As I recall I added wireless from Xcode but it wouldn’t show up in the list until the Apple TV was in that add remote/app menu. Then I selected and it would display a prompt on the screen on the Apple TV which I entered into Xcode to link the device.

I didn’t have any trouble connecting multiple Apple TV’s to both my Mac Pro and MacBook Pro. Perhaps a reboot of both and another attempt to pair might clear it?

Jim

According to Apple it does. However, I don’t own a recent ATV, so I should crawl back under my rock.

Perhaps on the non-4K version

I have had a Dev Account for a number of years already… and it shows up in an ATV project. but with that error below.

wow… took it almost 40 minutes, but finally Xcode finished “setup”

And I had to actaully RUN a blank app on the real device via Xcode for it to clear the Profile errors…

So now to see if I can write a REAL app :slight_smile:

Thanks

You’re right. My apologies.

@Dave S , glad you got it working! I’m currently working on one myself. Thus far I’ve found things fairly familiar to traditional iOS devices. This is my first project to include Apple TV and first switch over to Swift as well from ObjC as I’ve been developing backend stuff the past few years so I missed the transitions. Sounds like I missed some fun with the breaking changes in the early versions as luck would have it.

@Paul Rodman, I just checked my fourth generation Apple TV and it still has the USB-C port but it’s apparently been dropped on the 4K models. I received the 4th generation with that 1 dollar deal they ran when the opened things up to developers. The cheapest apple product I ever got! Less than the price of a cable.

Just got a “HELLO WORLD” using UILabel to run on my actual DEVICE>… Thanks, it was a bit frustrating to set up…
I have been doing iPhone/iPad stuff for a while, and developed tons of Libraries etc… . I hate Autolayout so all my GUI is done in 100% code. Now to see what it takes to add “pragma” to my existing code to make it reusable for ATV.
The nice thing it seems that ATV has ONE device resolution, which simplfiies things immensely.

Thanks!

Ok… why does the ATV turn off after a few minutes of running my app? Not just stop the app, but powers down (or goes to sleep), something it doens’t seem to do otherwise

I’ve not been facing that as yet though I’ve not left for any great length of time. I have my Apple TV sleep set for 30 minutes from the default 15. Presumably you an override this like you can on iOS. I would imagine some actions like AVKIT stuff by default does this.