This manual page is primarily aimed at helping developers transition from iOS to tvOS. The Apple TV platform (also known as tvOS) builds on the foundation of the iOS platform while creating new paradigms and challenges for game developers. Deploying an existing mobile game on tvOS is just one click away, but game content often needs to be adapted to work correctly with Unity’s new input controls and the fact that the game is displayed on a big screen.
To develop for tvOS you need the following:
otool -l
.The Apple TV Remote (Siri Remote) serves as a multi-purpose input device, working both as a traditional menu navigation controller, game controller, gyro and acceleration sensor, and as a touch gesture device. Apple TV Remote input is minimally processed by Unity and mostly routed to corresponding Unity APIs.
Usually, each game needs slight adjustment of its input scheme to leverage unique Apple TV Remote input features. Some games would benefit from treating it as a traditional game controller, with one analog axis and an extra action button, while others would benefit from using the accelerometer (for example, for steering purposes). It is recommended that you experiment with various schemes when porting a game to tvOS.
Here are some technical details on accessing specific TV Remote features:
Input.touches
(Touch.type
is set to Indirect
and is ignored by the Unity GUI), and the usual Joystick Input API (e.g. Input.GetAxis("Horizontal");
)Input.acceleration
and Input.gyro
. Input.acceleration
internally is derived from gyroscope API and might have some instabilities. Unfortunately there is no dedicated accelerometer API in the tvOS SDK. Input.gyro.attitude
is derived from the gravity vector, and thus lacks rotation around the axis parallel to the gravity vector. The same applies for Input.gyro.rotationRate
.UnityEngine.Apple.TV.Remote.allowExitToHome
is true)UnityEngine.Apple.TV.Remote.allowExitToHome
is false. This the default behavior.UnityEngine.Apple.TV.Remote.allowExitToHome
UnityEngine.Apple.TV.Remote.allowRemoteRotation
UnityEngine.Apple.TV.Remote.reportAbsoluteDpadValues
UnityEngine.Apple.TV.Remote.touchesEnabled
Warning: due to the Apple TV Remote “Menu” button being reported as joystick button 0 when UnityEngine.Apple.TV.Remote.allowExitToHome
is set to false, and the default Input Manager binding “Submit” virtual button being mapped to the same joystick button 0, this button triggers actions on UI elements when pressing the “Menu” button. To work around this issue, remove or modify the “Submit” virtual button bindings in the Input Manager.
This allows you to navigate your UI via the keyboard while running in the Editor and via Apple TV Remote swipes and full stop click when running on your device.
Note: Apple TV Remote navigation does not work while running in the TV Simulator.
Game Center requires custom visual resources to be provided for its native leaderboard UI. Here are quick instructions on how to set them up in Xcode:
tvOS has strict requirements on how much disk space your application can reserve. The main application installation bundle size can not exceed 200 MB. However, the limits for additional downloadable content are much higher (up to 2GB for in-use assets and up to 20GB of total downloadable content). Apple recommends On Demand Resources (ODR) for tvOS downloadable content, as it enables the best disk space management strategies for tvOS. Unity supports ODR via Asset Bundles. An ODR implementation guide can be found in our dedicated blogpost on the subject.