Distributing Your iOS Application Using TestFlight

An easy, step-by-step explanation for setting your app up for beta distribution


Background

TestFlight is a platform that allows developers to easily distribute their application to testers, track simple user analytics. TestFlight includes user analytics through checkpoints, in-app surveys for feedback, crash reports, remote logging, and much more. To get started, all you have to do is create an account, start a team, and start sending invites.

The remainder of this guide will cover how to add tester devices to your developer account, generate an ad-hoc provisioning profile for your testers to use, configure Xcode to build using the provisioning profile, and upload the build to TestFlight, using either the desktop app or the TestFlight site.

This tutorial assumes you’re familiar with the Apple Developer Portal and have already generated your own development and distribution certificates.

Suggested Tools

One of the best tools to have for this tutorial is the TestFlight Desktop App, which will automatically detect when a build is done, and given that the app is running, prompt you to upload the build.

Adding Devices

First you’re going to have to login to the Apple Developer Portal and go to your Certificates, Identifiers, and Profiles page:

The Certificate, Identifiers & Profiles page

The first step is to add the devices of testers you wish to distribute your app to. Click “Devices” which will list all devices that are registered to your account*. Click the “+” button in the top right corner, below the navigation bar to begin adding devices.

Here, you can either add devices one by one using the device identifiers, or you can have TestFlight export a .txt file containing names and device identifiers for each registered tester. To generate the text file, continue reading, or you can skip ahead to “Generating Provisioning Profiles”

Exporting TestFlight Devices

Go to the “People” tab of your TestFlight dashboard and select the users you would like to distribute to using the check boxes next to their names. Then click the “Actions” drop down and select “Export iOS Devices.”

The People tab of TestFlight

Your browser should begin downloading a file called “testflight_devices.txt.” This file is just a formatted text file that contains the name and device identifier of your testers. Save this file somewhere where you can easily access it, as you’ll be uploading this to Apple. Navigate back to the “Add Devices” section of the Developer Portal, select the “Register Multiple Devices” radio button, and upload the file you downloaded from TestFlight.

Generating A Provisioning Profile

Click on the “Provisioning Profiles” section and then the “Distribution” item on the left side of the page. There you will see a list of all distribution provisioning profiles currently associated with your developer account.

All Provisioning Profiles

Click the “+” button in the top right, below the navigation bar to generate a new profile.

  1. Select the “Ad hoc” radio button and press continue.
  2. Select your app’s bundle identifier from the drop down (it’s usually best to avoid using the wildcard identifier) and click continue.
  3. Select your distribution certificate and continue.
  4. Select the users/devices from the table view that are registered on TestFlight and click continue.
  5. Name your profile something that will help you identify it’s use in the future, i.e. “App Name TestFlight Distribution”
  6. Click generate

Generating the profile will take a couple of seconds. When it’s done, it should appear in the list of distribution provisioning profiles in your Developer Portal.

Now that everything is set up for your developer account, it’s time to configure Xcode!

Configuring Xcode to Build for TestFlight Distribution

Syncing Changes Made in the Developer Portal

  1. Open the Xcode > Preferences drop down on the Application bar
  2. Select the “Accounts” tab
  3. If necessary, add your Apple ID by clicking the “+” in the lower left corner.
  4. Login with your Apple ID and click “View Details” in the lower right corner.
  5. Click the refresh icon in the lower left corner and wait for your profiles and certificates match the ones listed on the “Certificates, Identifiers, and Profiles” section of the Developer Portal

Configuring Build Settings

Open your project in Xcode and show the navigator if necessary.

  1. Select the .xcodeproj in the navigator
  2. Click your app’s target in the menu directly to the right of the navigator
  3. Select “Build Settings” from the top menu
  4. Type “code signing” in the search bar
  5. Configure your code signing identities. The “Debug” certificate should be your development certificate, and the “Release” certificate should match the certificate used to generate the ad-hoc TestFlight distribution profile earlier.
  6. Configure your Provisioning Profiles. The “Debug” profile can be your wildcard or named profile, while the “Release” profile should be set to the “App Name TestFlight Distribution” profile we generated and synced to Xcode.
How to configure Code Signing Identities

Archiving Your Application for Distribution

Almost there! If you downloaded the TestFlight Desktop App, if it isn’t already running, start it!

The next step in the process is to build your application for distribution. Make sure that you bump your version numbers in the “General” section of the build target! If you’ve ever distributed an app in the App Store, this process is very similar.

  1. Click the “Product” drop down menu in Xcode
  2. Click “Archive”

When the archive build is complete, Xcode will open up the organizer.

Using the Desktop App

TestFlight Desktop App is running, a notification window should pop up in the top right prompting for user action to upload the build. If you miss the pop-up, you can select the TestFlight app from the menu next to the system clock and select your build version from the drop down.

Using the Site

To generate an .ipa file to upload to the TestFlight site, open up the organizer window, click your most recent build, and follow these last steps:

  1. Click the distribute button
  2. Select “Save for Enterprise or Ad Hoc Deployment”
  3. Select your “App Name TestFlight Distribution” profile from the drop down and click export.
  4. Go to your TestFlight dashboard, click “Upload Build” and follow the on-screen instructions

Congratulations!

Your application is now being distributed to your testers! If you have any questions or concerns, feel free to reach out to me on Twitter @justinmakaila and be on the look out for my company’s new iOS app, Present!

*Keep in mind that you’re limited to 100 devices per developer account.

Email me when Justin Makaila publishes or recommends stories