Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Games for phones and Apple TV

Tick iOS and tvOS or Android in the Build window, and you get a project: the same kind of project an app maker writes in Xcode (for Apple’s devices) or Android Studio (for Android). Your game is already inside it, with its name, its bundle id, its icon and its orientation. The engine is in there too, ready-made, so there’s nothing to compile but the app itself.

You finish it in Apple’s or Google’s tool. That’s where an app is signed with your name, tried on a real phone, and sent to the store, and those belong to your Apple and Google accounts, not to the IDE.

Before you build

In Project info:

  • set a Bundle id, like com.yourstudio.yourgame. The Build window won’t make a phone project without one;
  • choose the Orientation: Landscape (the phone held sideways, the usual for games), Portrait, or All.

And put a 1024 by 1024 icon.png in the project’s top folder. The build makes every icon size Apple and Google ask for from it.

iPhone, iPad and Apple TV

You need a Mac with Xcode, which is free from the Mac App Store.

The build makes a folder ending in -apple. Open GameTemplate.xcodeproj in it, and Xcode shows one project with two apps in it: GameTemplate iOS, for iPhone and iPad, and GameTemplate tvOS, for Apple TV. Pick one at the top of the window, pick a simulator beside it (an iPhone, say), and press Run (the ▶ button). The game starts in the simulator.

To try it on your own iPhone, or to sell it, you need an Apple Developer account:

  1. Click the project in Xcode’s list, pick the app, and open Signing & Capabilities. Choose your Team there, and leave Automatically manage signing ticked.
  2. Plug in your iPhone, pick it at the top instead of a simulator, and Run.
  3. Under General, set the Version people see (like 1.0.0) and the Build number, which must go up every time you send the store a new one.
  4. To send it to the App Store, pick Any iOS Device, then Product → Archive, and in the window that opens, Distribute App.

The project’s README.md and CHECKLIST.md go through the rest: the launch screen, the Apple TV’s layered icons, and what Apple asks for before a game goes in the store.

Crash-tan’s Tip: On Apple TV, a game’s saved files can be cleared away when the box runs short of space. If your game saves progress and you’re making the Apple TV app, read “tvOS caveat” in the project’s README first.

Android

You need Android Studio, which is free from Google.

The build makes a folder ending in -android. In Android Studio, choose Open and pick that folder. It takes a minute to look the project over the first time. Then pick a phone (a real one plugged in, or an emulator from Device Manager) and press Run (the ▶ button).

Before sending it to Google Play:

  1. In app/build.gradle, set versionName, the version people see (like "1.0.0"), and versionCode, a whole number that must go up every time you upload a new one.
  2. Make an upload key, which is how Google knows later versions are from you: Build → Generate Signed App Bundle or APK… makes one and signs with it. Keep the key and its password somewhere safe. Lose them, and you can never update the game again.
  3. Choose Android App Bundle, which is what Google Play takes, and upload it in the Google Play Console.

The project’s CHECKLIST.md lists everything Google Play asks for, from screenshots to the content rating.

Building again

A new build into the same folder makes the project again from scratch, replacing the old one without asking. Anything you changed in Xcode or Android Studio, like the team, the version or the signing, has to be done again.

So once you’ve set a project up, you may rather keep it and only give it the new version of your game. The game is one file in the project:

  • GameTemplate/game.crashcart in the Apple project,
  • app/src/main/assets/game.crashcart in the Android one.

A new build’s game.crashcart can replace it, if both builds were sealed with the same secret, since the app only opens a cart sealed with the secret it was built with. So Generate a Game secret in Project info, once, before you build the projects you mean to keep.

Crash-tan’s Tip: Selling things inside your game? The products are listed in the game’s iap.json, and the Apple project gets a test store made from it, so you can try buying in the simulator. Both checklists explain how.