Skip to main content

How the new Apple TV uses On-Demand Resources to host great apps and games

Apple TV Remote
Apple TV Remote

Based on a screenshot from Apple's developer guidelines, there are some folks up in arms about the new Apple TV's 200MB limit for app bundles (the app you download from the Apple TV's App Store).

200MB isn't a whole lot of storage for game levels, offline content services, or anything really of the sort. The good news is, 200MB is just the size limit for your initial App Store download. Once you open the app, you can download up to 2GB more per app, with up to 20GB of other resources available in the cloud. Apple lets developers do this by using On-Demand Resources, and here's how it works.

On-Demand Resources 101

Let's say you, the developer, make a side-scroller app for the Apple TV with 50 levels. All together, your app bundle comes out to be something like 4GB—too much for the Apple TV's App Store to properly host. Instead, you can take avantage of a new tvOS/iOS feature called On-Demand Resources to slice up your app and deliver it in parts to the user.

Instead of making the user download 4GB off the bat, you slice up your app into a bunch of sections, called tags. You include the essential parts of the app—loading and launch screen, scores, settings, and the first five levels—in that 200MB bundle.

Other levels and assets are split into multiple tags that range in size from 64MB to 512MB. If you sliced up tags that all sized out to 100MB for your game, for instance, you'd have 38 additional items for download once a user installs the game. Those don't come all at once, however: They're called on-demand, when a user needs them.

How On-Demand Resources work in action

When a user downloads your app, they're downloading that initial 200MB app bundle, with all the basics held within it. From there, developers can also mark up to 2GB in initial install tags for download upon install—this means that when a user finishes installing and opens the app, they can get up to two additional gigabytes worth of resources in the background.

In our scenario above, the initial 200MB bundle might just be your game's launch screen and the like; once a user opens your app for the first time, however, it would call an additional 2GB that included the first 25 levels.

At this point, your game is using 2.2GB of data—2GB of on-demand resources, locally downloaded, plus the other 200MB from the original app bundle. This is the true storage number that the Apple TV supports at any one time: 2.2GB.

But: You have a 4GB game! How do you get those other 25 levels?

Easily, thanks to the power of background processing. On-Demand Resources works in conjunction with whatever your user is actively accessing, and will flush older, unused content to make room for additional resources. If a user is playing level 24 of your game, the system automatically flushes a few 100MB tags of old levels (say, 1-5) to make room for levels 25-30. As the user gets further into your game, older levels drop off and get deleted from the Apple TV, and your new levels (also in tag bundles) get installed—all in the background.

You can host up to 20GB of On-Demand Resources on the Apple TV's App Store. Though our hypothetical game may only take up 4GB, the 20GB offers a lot of potential for other, more complex games and apps.

TL;DR: There's a lot of potential for games and apps on the store

To to recap: 200MB is the initial app bundle. 2.2GB is how much space an app can take up at any one point. 20GB is the maximum amount of Apple-hosted resources you can have for any one app.

In contrast, iOS allows up to 2GB for an initial app bundle, with another 2GB available in tags, for a total of 4GB in space per app. So the Apple TV is working with less space than iOS, yes. But it's not hampered to 200MB apps.

Many thanks to Apple's excellent developer documentation on On-Demand Resources{.nofollow} for helping straighten this out. Any other questions about this? Let me know in the comments and I'll try to sort it out.

Serenity was formerly the Managing Editor at iMore, and now works for Apple. She's been talking, writing about, and tinkering with Apple products since she was old enough to double-click. In her spare time, she sketches, sings, and in her secret superhero life, plays roller derby. Follow her on Twitter @settern.

37 Comments
  • It will be interesting to see how this works on slow connections. What was wrong with allowing an external USB or SDHC slot? Apple could have nailed this by allowing an external drive and my one beef with ATV is still that they won't let me access movies on my NAS without a jailbreak.
  • If you only have an apple tv I could buy that complaint, but why would you only have that device? Use airplay, I do it all the time, send a movie from my NAS to ATV.
  • Because it makes less sense to have to rely on two devices instead of one. So what? You are using your laptop to access your NAS and send it to your ATV? Direct access to a large library would be better.
  • No, I use my iPhone. I didn't say it made more or less sense, I said it was possible without going through the hassle of jailbreaking.
  • Well you let me know when you figure out how to get the contents of my 12TB NAS on your iPhone. Ill be all over that. Simply put, an App to access network storage would be nice rather than having to airplay it or leave iTunes running on my mac all the time.
  • I agree it would be easier, in lieu of that.... Whether you have a QNAP or Synology NAS, both of them make iOS apps that allow you to download, view, and/or push to AppleTV via airplay from any iOS device. I'm not sure which NAS you have but if it's somewhat modern I would assume 'there is an app for that.' Which NAS do you have?
  • UNRAID - http://lime-technology.com
  • So, you're NAS doesn't have specific iOS apps like QNAP or Synology but here are options. I just did a quick scan so I'm not saying these are the best options or only options, just that there are some. Both are pay for apps, but if you go through the LimeTech forums you would probably find a free option that would require a little setting up. Again, not the easiest but should be easier than jailbreaking the AppleTv. https://itunes.apple.com/us/app/filebrowser-access-files-on/id364738545?... This one needs an available plugin for the LimeTech UnRaid.
    https://itunes.apple.com/us/app/air-video-hd/id668354926?ls=1&mt=8&at=10... Plex is another option:
    https://itunes.apple.com/us/developer/plex-inc./id383457676?at=10l3Vy
  • I run iTunes on my nas and access all the movies thru the "my computer" app Sent from the iMore App
  • The device's primary function is high res Internet video streaming. Not really built for slow connections.
  • Why are TL;DR's always at the bottom?
  • For the people who skim through the article. :)
  • I know, but if I'm lazy I want it at the top.. ;)
  • I honestly had no idea what that meant, but was surprised that the definition is available in iOS!
  • This is an awfully convoluted way to avoid just providing more storage, either internally or externally. An for those of us who don't always have great internet connectivity, this isn't really ideal.
  • Exactly.
  • If you don't have great Internet connectivity, a device built around online video streaming is probably a poor choice for you.
  • Not really, it also helps with asset management with older hardware. This plays heavily with games that work on older phones / hardware that do not need 'retina' assets, for example. Pushing Dev's to do asset tags makes it very easy for dev's to make sure you're getting the content your system can use.. A future use case is when ATV 5 comes out with 4k support. but you don't have a 4K TV and want to just keep your ATV 4.. You'll only download the 1080p content, not the 4k content. It's all tied together to make sure it's efficient use of resources.. It also ensures a game can be played quickly w/o having to wait for 20GB's to download just to start playing.
  • This would only work for completely linear games, which is a style of game design which is greatly declining these days. Open world is now the dominant type of game, where the game will need to access any part of the map at any time. The 200mb limit is frankly retarded and makes no sense. It will cripple what is possible on the box. Well, that and the lack of a bundled game controller (no, a remote control with waggle isn't a game controller), and the antiquated underpowered GPU.
  • That's a good point about linear games.
  • You can put many GBs in on-demand resources for any app.
    You can download them in the background or up front.
    They will only be purged if the storage runs low, and if your app isn't recently used. And if that's the case, better for the user that their device purges your app.
  • "Easily, thanks to the power of background processing" This isn't going to be about "background processing", the chokepoint will be your network connection.
  • While I definitely appreciate the attempt to spin this - no matter how you "slice" it (see what I did there?) it's a pretty bonehead move for Apple and will further make it difficult for developers to develop quality (read not just iOS ports) games... And will create great opportunity for user friction and bad experiences with many game types... Don't believe? Say you're developing an action/adventure game like you would on any system/console... you play through let's say the first 24 levels and tvOS purges the first few levels/tags to eliminate space... Not a big deal until surprise surprise, for this particular level/quest/section of the game you need to go and find an object or special weapon that you overlooked in the first few levels.
    No problem the user says - they'll just run over to level 3, but WAIT A MINUTE??? Level 3 was purged because you are on the latter half or 2nd chunk of the downloadable content. Now you are stuck waiting for your game to load slices from the initial game download so you can run and get that special item or weapon. The user experiences an inordinately long level loading time because they have to load the first 1 maybe 2 gigs on the fly? Or even 500Megs on the fly.
    This creates user friction and now the user thinks that something is wrong with the game or wrong with the Apple TV. Of course now that the user is loading the first parts of the game again, the latter parts of the game have now been purged - again to stay within the app size limits. So once the user gathers the item and loads the later level, another marathon download/purge session begins...
    This is bad. No amount of "we thought of everything" spin is going to change the fact that this is bad. This will keep the quality, true console style games away and what you'll be left with are silly games like runners or "action games" that are on serious rails that you could have just played on your phone anyway. This won't allow for unique experiences/games that could only be done well on a TV with a controller like console style console quality games. Again - this is a bonehead limitation
  • Whoever downvoted you apparently doesn't game. :)
  • That's ok. That's the great thing about the truth... It doesn't need anyone to believe it or agree with it or even like it for it to be true :)
  • "Say you're developing an action/adventure game like you would on any system/console... you play through let's say the first 24 levels and tvOS purges the first few levels/tags to eliminate space... "
    In that scenario the device would purge from the other 32-64GB on the device, not your active game. Your other points are equally nonsensical. A lot of doomsayers here with a limited grasp on how this actually works in practice. Clever developers will have no problem with this.
  • What's nonsensical is you giving a perspective on this without checking the SDK and poking around in there. I've been sifting through it the last couple of days and in fact NO it won't purge other developers app data and leave your current active game/app in tact. You are 100% incorrect. This is actually attested to in this article itself and I quote "To to recap: 200MB is the initial app bundle. 2.2GB is how much space an app can take up at any one point. " Emphasis on "an app can take at any one time". Meaning that it will purge directly from the app you're using. To recap, you answered not only without looking at the SDK yourself, but also without thoroughly reading the article itself to which you're posting.
  • Uh, no, YOU are wrong. I've been coding against ODR for months now.
    When they say "up to 2 GB" at one time, they mean that you can only be making active *requests* for up to 2 GB of resource tags at any time. Get back to me when you've written the code. Specifically: You can only have NSBundleResourceRequests active at any time for up to 2GB. But your old resources stick around, which is exactly why the conditionallyBeginAccessingResourcesWithCompletionHandler: function exists.
  • BrerTeoh is correct, you can request resource for up to 2GB at any time while retaining the old resource on the active game by using BeginAccessingResourcesWith CompletionHandler. Apps can access resources after the completion handler of either beginAccessingResourcesWithCompletionHandler: is called with no error.
  • Not sure why, since this has been the way it's been on iOS for a little while now. DEVs are not up in arms.. but I guess you get to be the 'mouth' of the devs then? lol
  • For iOS yes but for this? It's a new ballgame with ATV and the kinds of limitations that can be rationalized and excused with iPhone or iPad which have limited battery and are tied to cell/carrier bandwidth unfortunately just can't be excused for a device that has no battery concerns and is not inhibited by bandwidth or speed by nature. Devs aren't in arms for mobile devices now because these limitations COULD and in most situations DO make sense... However there are certainly already rumblings on numerous forums of well respected mainstream devs and cross platform console based devs/publishers... I'm by no means a "doomsayer", I think the device is good and certainly looking forward to getting one on day 1. It's just unfortunate that artificial limitations that will most certainly hold the platform back from a big market such as non-casual gaming are put in place.
  • All of this seems to be said without understanding that a developer properly designing such a game would break each level into further chunks. That is, a 400MB group of tags for 5 levels would be broken into further chunks. In that way, needing to go back to level 3 would not be a serious issue and would not require downloading the entirety of levels 1-5. As stated in the article, no, going back to level 3 wouldn't purge the levels you were just on, even if they were on the latter part of the game. iOS 9 and tvOS use last access time to determine which assets are safe to purge, not their location in the game.
  • lol. You got to be kidding me. This is a joke of a workaround. Nothing but Tetris and shells of real games will be developed for this thing, which makes it an overpriced roku with less actual tv/movie apps. Hard, hard pass. Sent from the iMore App
  • If you feel that this is some kind of wonky workaround, I think you aren't seeing the long term picture. This is part of a bigger play to move toward streaming apps, which ultimately will provide a superior experience for users (no needed to worry about space, much faster app installs, and, if done well, no change to to the user experience). I've written up some fuller thoughts here:
    http://www.jamesabooth.com/blog/2015/09/on-demand-resources-the-age-of-t...
  • While I can appreciate the attempt to spin Apple's cheapness, as many people have already pointed out, this only works for linear games, and leaves out all sorts of games. Streaming apps is not a superior experience to having the app local. It limits the kind of games and introduces it's own set of challenges. So, yeah, the Kwazee Kupcakes of the world will work fine on the Apple TV. The upcoming Fallout game? Not so much.
  • I wouldn't be so quick to jump to conclusions about what developers can and cannot achieve. Have you ever tried the streaming install of World of Warcraft? I can't find a good answer for how much download is needed to get you in the game, but someone on this thread is reporting (conveniently enough) 200MB: http://eu.battle.net/wow/en/forum/topic/831474007 I'm not arguing that Apple isn't stingy with storage amounts - 16GB on the 6s is frankly a mistake. At the same time, I don't see On-Demand Resources as some short-term hack that Apple engineers cooked up to limp on with small storage amounts. To me, it seems clear that Apple is trying to get to a place where storage restrictions are not a concern of end users (iCloud Photo Library being the other recent development that comes to mind). As great as an Apple TV with 256GB of storage would be it would still easily get full of large games. Users would still have to manage that problem when it occurs, deciding what to delete and keep, knowing that re-installing an app is a huge monolithic download away again. It's all just a terrible experience for the average user. It will take a few years to get there, but on constantly connected devices streaming apps sounds like a sensible direction to head in to remove all these issues. On-Demand Resources are the first step in that direction.
  • I have probably streamed more games than the average person, and the fact remains it's a worse experience than having the game local. It's not even close. I don't think Apple made a short term hack for the Apple TV, I think on-demand was designed with the phone in mind, and is an after thought with the Apple TV. And sure, maybe in some future time everyone will have fibre to the home and Apple will have edgepoints in every ISP, with sub 20ms latency between server and Apple TV. But that won't be today, tomorrow, or probably 5 years from now. In the mean time, put some reasonable storage and limits in there so the users playing the games in the present have more options.