Building for the new AppleTV / tvOS

Anyone tried building coos2d-x for the new Apple TV yet? I’ve only just downloaded the beta SDK and tried adding a tvOS build target. A few things need to be changed on the new target:

  • Changing the Base SDK to Latest tvOS
  • Change the Valid Architectures to only have arm64
  • ???

I’ll keep y’all posted!

UPDATE – Working HelloWorld

hawkwood has created a modified version of v3.8 running on the tvOS simulator. Some libraries are disabled, including Simple Audio Engine. But this is a start!

10 Likes

I am very interested in this too. Looking at the iOS 9 to tvOS diffs, there are a lot of things that will need to be removed/replaced.

I am particularly interested in this. Like hawkwood said, though, it looks like it’s not a small job. Guessing it’ll be a “for 3.9 or 4.0” type deal.

Looking for news. I wonder how fast someone would be able to run hello world on it. Btw how input is looking in tvOS? Is that just some point on screen or a gesture?

We too in Balzo are interested at the discussion, we have just received a development kit and we would like to exploit the potential of cocos on the Apple TV

I have also received the good news of getting the hardware from Apple, and I will be able to assist and try on the hardware. So I will be able to contribute on this.

I have modified the Hello World project form 3.8 to open in the AppleTV simulator. To get it done quickly, I had to comment out some stuff that may be important to others, like the Simple audio engine. Additionally, I did not start adding remote control input handlers, so at the moment there is no way to interact with the app, unless you already have game controller support added. I will put the modified source up on GitHub later today.

[EDIT] we are looking into the NDA regarding tvOS to see if we can share the project on GitHub, since it technically contains code from a pre-release SDK.

Nice work, hawkwood. Looking forward to the code.

My dev kit should arrive on Monday. I’ll test it out ASAP.

Determined that NDA allows us to share code based on tvOS API since it is publicly available on Apple.com

@ricardo please keep us apprised if someone integrates this in to the Cocos core.

2 Likes

@hawkwood yeah!

Thanks @hawkwood, it works flawlessly.

Thanks.

In addition to disabling SimpleAudioEngine, VideoPlayer, and web view (due to certain classes not being supported on AppleTV), there are 2 places where system() is called, and that is also not supported on the AppleTV, so to get this out ASAP, I preprocess commented those out, returning false where appropriate.

This will be great if incorporated officially and can start to port some games to tvOS :smiley:

Do you know what Audio APIs are supported? CoreAudio, AVAudioPlayer? Sorry I haven’t had time to play with it yet.

Not sure exactly, but I know that the new audio engine works.

1 Like

Regarding input, touch works with the built in single touch methods in Cocos2d-x but click doesn’t work ATM.

Just tested the hello world project on my AppleTV dev kit. All good so far!

I have a game written with cocos2d-x v2.2.6 - would you recommend updating to v3.8 OR try to get the game working as-is with v2.2.6? Looking for the shortest path to get it on Apple TV. I just got the developer kit today.

I would move my source to 3.8 and then use @hawkwood’s modifications. But then I’m not at 2.2.6 so that might be a troublesome way to go depending on how much source you have to move upwards.

Has anyone added input to the Hello World example given by @hawkwood yet?