Unity3D for iOS: Setting Up a New Project and Deploying for QA with TestFlight

NOTE: This post is definitely in the Notes to Self category. Not sure how useful this may be to anyone I’m not directly working with.

Apple Developer Center

There are plenty of free tutorials on how to do this but here’re the steps:

1. [First time only] Set up Apple Developer Account & Create your personal Certificate in .p12 format.
2. Create an App ID
3. add Device IDs if needed
4. Create Dev Provisioning Profile & download it to your machine.

Set Up Unity Project for iOS

  1. Create a New Project & go to File > Build Settings > Player Settings
  2. Fill in Company Name & Product Name (the app name you picked in Apple Dev Center when setting up the App ID).
  3. In Player Settings, under Per-Platform Settings in Other Settings set Bundle Identifier* to the App ID you created in the Apple Developer Center (something like “com.yourcompany.yourAppName”)
  4. Other Player Settings seem fairly self-explanatory if you’ve done iOS dev before

Import Your Assets, Copy/Paste Items

  1. Imported your team mate’s game scene(s) from their latest .unitypackage.
  2. Imported MainMenu & endGame scenes, import level1 and level2 for reference from Cubesteroids3 (or latest).
  3. Add any GameManager or GameSettings objects & their related scripts to the Hierarchy in the imported scene.
  4. Add UIToolkit’s UI object to imported scene. Notice, it’s UILayer setting in Inspector will probably be unset. If you don’t feel like updating this every time – turn UI and it’s children into a Prefab, which will retain layer settings for you.
  5. If a Layer named UIToolkit doesn’t exist – name User Layer 10 (or one of your choice) “UIToolkit”. Click on UI in the Hierarchy, in the Inspector the UILayer setting should now be set to UIToolkit.
  6. Select “UIToolkit – text” in Hierarchy, in the Inspector the Layer should be set to UIToolkit. If not, manually set the Layer to “UIToolkit” in the Inspector.
  7. Merge ui / gui code from the old [GameManager class called] ThrowRigidBody.js to the new ThrowRigidBody.js. Without a “Team License” from Unity Technologies, this is a manual, line-by-line process unfortunately.

Prior to Build & Run

  1. Download your Dev Provisioning Profile
  2. If it’s an official release, make sure you’ve switched the Dev Provisioning profile from a test one to one using your Team’s Apple account
  3. Open Xcode. Do Window > Organizer.
  4. Drag your Dev Provisioning Profile into your list of profiles in Organizer. Connect your Device – you might need to drag a copy of the Profile to your device’s Provisioning Profiles tab in Organizer
  5. Hit Build & Run in Unity… should work.

To Distribute Wirelessly via TestFlight

  1. Set up an account at TestFlightApp.com, if you don’t already have one OR ask to be added as a Developer to an existing Team account.
  2. Open the Xcode project generated by Unity when you Build & Run
  3. Create an Archive in Xcode. When the Archive is read, click the SHARE button in the upper right corner of the IDE. Choose the appropriate Dev Provisioning Profile (there can be several in the list if this isn’t your first iOS project). Choose where to save the .ipa. If this part is confusing – a quick Google search will help w/ sources like Stackoverflow.
  4. Drag the .ipa into TestFlightApp.com’s Upload page.
  5. Follow TestFlight’s link to Invite Testers. NOTE: After new testers register their devices you might have to add them to your Dev Provisioning Profile via Apple’s Dev Center, recompile your app w/ the new profile & reupload your .ipa. Not sure if TestFlight has found a faster workaround to this.

To Quickly Allow a New TestFlight User to Install Your Build

  1. Send them a Tester invite via TestFlight. After they register their device, grab the Device ID.
  2. Add Device ID to your/your team’s Apple Developer Account
  3. Add the newly added Device to a Dev Provisioning Profile for your App ID
  4. Download your new/updated Dev Provisioning Profile to your machine
  5. On TestFlightApp.com go to Builds > Your Latest Build, choose Permissions in the left nav.
  6. Click on the UPDATE PROFILE button under Update Provisioning Profile to upload the new Dev Provisioning Profile that includes the new Tester’s device ID. This step allows you to skip re-compiling your app just to add dev install permissions for a new device.
  7. Notify your new Tester.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s