Skip to content
Tutorials Center
My learning

Topics

Lesson 38 of 46 ยท Testing and Shipping

Signing, TestFlight and App Store Release

Ship an iOS app: certificates, provisioning profiles, bundle IDs, capabilities, TestFlight testing, App Review guidelines, privacy labels and version and build numbers.

Writing the app is only half the job. To put it on a real device, a tester's phone or the App Store, Apple requires that every build is signed, so the device can check who made it and that nobody changed it. Signing is the part of iOS development that confuses newcomers most, mostly because it involves four or five separate things with similar names.

This lesson explains those things in plain order: identities, identifiers, profiles, capabilities, then the path from an archive to TestFlight and the store, including App Review, privacy labels and version numbers. You need an Apple Developer Program membership to distribute; none of the Apple-side steps can run here, so they are read-only. Two small stand-ins model the rules you can express in code.

Four pieces make a signed app

Certificate Proves who you are.
App ID Names the app and its features.
Devices Which phones may run development builds.
Profile Binds the other three together.

Xcode can manage all four for you with automatic signing.

1 / 2

Identity, identifier, devices, profile

Certificate. A signing certificate ties your Apple Developer account to a private key stored in your Mac's Keychain. Xcode uses it to sign builds. Development certificates sign builds that run from Xcode on your own devices; distribution certificates sign builds for TestFlight and the store. If you lose the private key (a new Mac without a backup), you create a new certificate; the old one is revoked.

Bundle identifier. Every app has a unique reverse-domain name such as com.example.Inbox, set in the target's General tab. It is the app's identity everywhere: on the device, in App Store Connect, in push notification setup. Choose it once; changing it later makes a different app. Register it as an App ID in your developer account (Xcode does this automatically when it can).

Devices. A development build only installs on devices whose unique identifiers (UDIDs) are registered in your account, up to a limited number per year. Builds distributed through TestFlight or the App Store do not need this, because Apple's own services handle installation.

Provisioning profile. A profile is a file that bundles an App ID, a certificate and (for development) a device list, plus the entitlements the app is allowed to use. The device checks the profile when launching. Profile types you will meet are Development, App Store (for TestFlight and release) and Ad Hoc (for a fixed list of devices).

Automatic signing

In your target's Signing & Capabilities tab, tick "Automatically manage signing" and choose your Team. Xcode then creates the App ID, certificates and profiles for you and renews them. Use it for almost everything. Manual signing is needed mostly for continuous-integration servers or special organization rules.

TEXT
# read-only: where signing settings live (Xcode > target > Signing & Capabilities)
Automatically manage signing   [x]
Team                           Example Studio (A1B2C3D4E5)
Bundle Identifier              com.example.Inbox
Provisioning Profile           Xcode Managed Profile
Signing Certificate            Apple Development: Ana Kovac

Capabilities and entitlements

Some features need Apple's permission before the app may use them: push notifications, iCloud, Sign in with Apple, App Groups (sharing data with a widget), HealthKit, and Keychain sharing. You enable each in Signing & Capabilities by clicking + Capability. That adds a key to the app's .entitlements file and enables the matching service on your App ID, and the profile is regenerated to include it.

A common symptom: "provisioning profile doesn't include the ... entitlement". It means the capability is on in code but not on the App ID, or the profile is stale. Toggle automatic signing off and on, or open the target and fix the capability.

Separate from entitlements, privacy-sensitive features need a purpose string in Info.plist that explains to the user why you ask. Without it, the app crashes the first time it requests access.

XML
<!-- read-only: Info.plist -->
<key>NSCameraUsageDescription</key>
<string>Inbox scans receipts with the camera.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Inbox saves scanned receipts to your photos.</string>

Write these in the user's words and be honest; App Review rejects vague strings like "needs camera".

Version and build numbers

Two numbers identify each build, both set on the target:

  • Version (CFBundleShortVersionString, "Marketing Version"): what users see, such as 2.1.0. You change it for a new release.
  • Build (CFBundleVersion, "Current Project Version"): an integer or dotted number that must increase with every upload for the same version. App Store Connect refuses a build whose number it has already received.

Many teams automate the build number with the commit count or a CI run number. The stand-in below compares dotted versions the way the store does, as numbers per component rather than as text, so 2.10.0 is newer than 2.9.0.

Swift Comparing version numbers

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with readLine()), it gets the next line from this box.

The last line prints false, which is the classic mistake of comparing version strings as text.

TestFlight

TestFlight is Apple's beta-testing service. The flow:

  1. Create the app record in App Store Connect (name, bundle ID, primary language, SKU).
  2. In Xcode choose a generic iOS device as destination and run Product > Archive. The Organizer opens with your archive.
  3. Click Distribute App > App Store Connect > Upload. Xcode signs the build with a distribution certificate and uploads it.
  4. After processing (minutes to an hour), the build appears in the TestFlight tab. Answer the export-compliance question about encryption; most apps that only use HTTPS can declare the standard exemption in Info.plist with ITSAppUsesNonExemptEncryption set to false.
  5. Add testers. Internal testers are members of your team (up to 100), get builds immediately and need no review. External testers (up to 10,000) join by email or a public link, and the first build for a version goes through a lighter Beta App Review.

Testers install the TestFlight app, accept the invitation and get each new build with release notes. Builds expire after 90 days. Use TestFlight early, not only before launch: real devices and real networks reveal crashes you will not see in the simulator, and Xcode Organizer collects the crash reports for them.

Preparing the store listing

In App Store Connect, the app's page needs:

  • Name, subtitle and description, plus keywords for search.
  • Screenshots for the required device sizes (the largest iPhone size is mandatory and Apple scales it for others where allowed), and an optional preview video.
  • Category and age rating, answered through a questionnaire.
  • Support URL and a privacy policy URL. A privacy policy is required for every app.
  • App Review information: contact details and, if the app has a login, a working demo account for the reviewer.
  • Pricing and availability: free or a price tier, countries, and release date options.

Privacy nutrition labels

The App Store page shows privacy labels, a summary of what data the app collects and whether it is linked to the user or used for tracking. You declare them in App Store Connect and they must match reality, including what your third-party libraries collect. Since 2024 the app (and each third-party SDK on Apple's list) must also ship a privacy manifest file, PrivacyInfo.xcprivacy, declaring the data types collected and the use of certain system APIs with a reason. See Keychain, Biometrics and App Security for more on the security side.

If you track users across other companies' apps and sites, you must also ask permission using the App Tracking Transparency prompt. Avoid tracking and you avoid the prompt.

App Review

When you click Submit for Review, a reviewer installs your build and checks it against the App Review Guidelines, which group into safety, performance, business, design and legal rules. Typical outcomes come back in a day or two. The most common reasons for rejection are practical:

  • Crashes or broken features (guideline 2.1): test the exact build you submit, on real devices, and supply demo credentials.
  • Incomplete metadata or placeholder content: lorem ipsum, missing privacy policy, wrong screenshots.
  • Purchases outside the rules: digital goods and subscriptions inside the app generally have to use Apple's in-app purchase system.
  • Misleading privacy declarations or asking for permissions you do not use.
  • Minimum functionality: an app that is only a web page in a wrapper, or a trivial template, may be rejected.
  • Account deletion: apps that let people create an account must let them delete it from within the app.

A rejection is a conversation, not a ban. The message names the guideline; fix the issue or reply in Resolution Center to explain. Resubmit a new build if code changed.

Releasing

After approval you choose how the version goes live: manually when you press the button, automatically after approval, or on a scheduled date. For updates, phased release rolls the new version to a growing share of users over seven days, and you can pause it if crash reports spike. Keep your archives and dSYMs, as Debugging Xcode Apps explained, because a phased release is exactly when you will need to symbolicate crashes quickly.

A pre-submission checklist is easy to automate in your head and in code. This stand-in models a tiny release gate that reports every missing item at once instead of stopping at the first.

Swift A release checklist gate

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with readLine()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a provisioning profile do?

    The device uses the profile at launch to confirm the app may run with those entitlements under that identity.
  2. 2. You uploaded build 7 of version 2.0 and want to upload a fix. What must be true?

    App Store Connect requires every upload for a given version to have a higher build number than the earlier ones.
  3. 3. Who can receive a TestFlight build without Beta App Review?

    Internal testers get builds as soon as processing finishes. External testers need the first build of a version to pass a lighter Beta App Review.
  4. 4. Why does an app crash the first time it asks for camera access, even though the code is correct?

    Protected resources require a purpose string such as NSCameraUsageDescription. Without it the system terminates the app.

Summary

  • A signed build combines a certificate (who you are), an App ID (what the app is), devices (for development) and a provisioning profile that binds them; automatic signing manages this for you.
  • Capabilities add entitlements; privacy-sensitive features also need honest purpose strings in Info.plist.
  • Version is what users see; the build number must increase with each upload.
  • Archive, upload to App Store Connect, then test with TestFlight internal and external groups before submitting.
  • The store listing needs screenshots, a privacy policy, privacy labels and, for apps with logins, a demo account.
  • App Review rejections are usually fixable: crashes, missing metadata, purchase rules and inaccurate privacy answers.
  • Phased release and kept dSYMs let you roll out safely and diagnose problems quickly.

Next: Project: A To-Do App