For the first time since Apple introduced the Apple TV in 2007, independent developers can now build applications for the hardware, thanks to Apple’s release yesterday of the tvOS software development kit (SDK).
The demo of the revamped Apple TV with tvOS flew by during Apple’s big Hey Siri event. But the tvOS code and documentation are out there now, so developers can take a look and see if they’d like to build for it. And non-technical types purely interested in the new Apple TV can also get a sense of its capabilities by taking a peek at the developers tools.
We checked it out, and so should you. To help you along, I’ve put together a brief overview of what’s out there and what developers can do right now. (Hat tip to developer Rick Walter over at Made Up By People for making a great tutorial video on tvOS, which inspired this article.)
Getting the tvOS SDK
Above: Apple’s Eddy Cue announces the availability of tvOS for the new Apple TV at Apple’s “Hey Siri” event in San Francisco on Sept. 9.
Image Credit: Screenshot
The brand new Xcode 7.1 beta integrated development environment (IDE) comes with tvOS and its SDK, so you’ll want to start by downloading that. You’ll need the latest edition of OS X Yosemite, version 10.10.5. Fair warning: updating your Mac could take 15 minutes or longer, and downloading the 4.57GB Xcode beta file won’t happen instantly, either.
Once you have the new Xcode running, select “Create a new Xcode project” in the pop-up window, “tvOS,” and then “Single View Application.” Give your app a product name and an organization identifier. Choose either Objective-C or Apple’s Swift programming language. Set it up with Core Data and unit tests if you want, hit Next, and then save the app to your desktop.
Hit the play button at the top left corner of the window. At this point you may have to enable developer mode on your Mac and type in your computer account’s password. Go ahead and do that.
A Simulator application will pop up. You can make the window smaller by going to the Window dropdown menu, selecting Scale, and selecting, for instance, the 75 percent option.
To use a simulator for the remote, go to the Hardware dropdown menu and click Show Apple TV Remote. Hold down the option key and use your trackpad or mouse in the black square on the Apple TV Remote in order to simulate using your finger to swipe on the real remote. A long press on the remote simulator, achieved by holding option and holding your mouse down on the black square) will allow you to drag and drop an app to different positions in this menu.
You can alternatively use the arrow keys on your keyboard to navigate. You may have to hit the Menu button on the remote simulator a couple of times to get that to work.
Above: The new Apple TV’s settings, as depicted in the Apple TV simulator in Xcode.
Image Credit: Screenshot
First, get a feel for the settings of the Apple TV.
Use the arrow keys or the remote simulator to select Settings and hit Enter. Note that the Menu button on the Remote brings you back a screen. Unlike many iOS apps, Apple TV apps will not generally include back buttons.
You can do a lot with Settings. You can control screensaver options, sleep options, the style of closed captions, screen contrast, motion, parental controls, iTunes Store purchasing capabilities, multiplayer support, and location services. You can limit ad tracking, too.
Users can sign in to iTunes to use apps and iCloud for storing app data. Users can sign in to Game Center here as well. Users can also configure AirPlay in Settings.
You can connect remotes other than the official one for the new Apple TV, and you can turn high-definition previews of video content in iTunes depending on the speed of your Internet connection. You can also decide if you want Apple TV to automatically or manually update its software.
Now you can go and try building an app for the new Apple TV. So go back to the Xcode application.
Building a test app
In the project navigator — the left column of the window — you’ll find components typical of apps for iOS, like AppDelegate, ViewController, and Main.storyboard. Go to Main.storyboard. In the second column, click the triangle to expand the View Control Scene section, and then click the triangle to expand the View Controller section.
With View Controller selected, click on the little square wedged between the curly braces and the rectangle near the bottom side of the right column of Xcode — it represents the object library — and in the text box at the very bottom, type in “button”, and drag a few of them into the big blurry box just to the left, which is the View Controller. Hit the play button at the top left again to see how it looks in the simulator. (You may need to set the active scheme again as “Apple TV 1080p” under the tvOS Simulator bar to the right of the stop button.)
Navigate around using either the arrow keys or the remote simulator. (Apple has best practices for app design in pre-release documentation for tvOS here.) Go back to Xcode’s object library and look around for other things you can add, including an Activity Indicator View, a Progress View, and a Navigation Bar.
If you wish, you can add content to your app when it’s in the Top Shelf, which is located at the top of the main menu. The Top Shelf is a place where Apple TV users can glance at featured content from their five favorite apps. Go to the File dropdown menu, select New, and select Target, click Application Extension under tvOS, and hit Next. Give it a product name and hit Finish. Xcode will ask if you want to activate this scheme, and you should click Activate. Then it will show up in the left column. Click the triangle to expand that section. The ServiceProvider.swift file is the important one for adding content like images to the Top Shelf.
Inside the ViewController.Swift section in the left column in Xcode, you can use the new Tap Gesture Recognizer, the Swipe Gesture Recognizer, and other user-experience inventions for the new Apple TV.
To explore a bunch of buttons, photo views, and other user interface options for tvOS, download the new UIKit Catalog sample code. Unzip the file and run the project “UIKitCatalog.xcodeproj”. Then hit the play button.
Apple has also prepared sample code for client-server apps, which display content in the new Apple TV markup language, or TVML. After you download and unzip the file, open the TVMLCatalog folder, run the “TVMLCatalog.xcodeproj” file, and hit the play button. In case you run into errors here, follow the instructions at the bottom of the project’s README.md file in Xcode.
Parallax Previewer app
Above: An animated GIF of a photo in the Parallax Previewer beta.
Image Credit: Jordan Novet/VentureBeat
You can install and run the Parallax Previewer beta app to see how certain images will look with Apple’s nifty Parallax effect, which happens when you hover over an app and gently move your finger around it with the remote.
Using the app is as easy as hitting the plus sign on the bottom left, uploading an image (choose a photo for example), and then clicking the play button in the center at the bottom of the application.
You can get slightly different effects if you turn the image into an “Apple TV icon,” and you can change the background as well. If you want to have some fun, try moving your mouse around the box in the middle of the application. You can export customized parallax images in .LSR format.
The sample game Apple showed developers to demonstrate iOS 9 earlier this year is also available for developers looking to understand tvOS.
You can find it online. Unzip the file, select Swift, and open “DemoBots.xcodeproj”. Make sure to select “DemoBots (tvOS)” from the Active Scheme menu near the top left in Xcode. Then press play. This one will take a minute or so to load. Hit the play-pause button on the remote simulator to get started.
This little run-through isn’t enough to help us determine whether the new Apple TV can become as common as iPhones and iPads, with their mobile app store. Still, developers have a lot to play around with, and based on what we’ve seen, there will soon be many more Apple TV apps for consumers to choose from.
VB’s research team is studying web-personalization… Chime in here, and we’ll share the results.