Submitting Your App to the Store

The next distribution step is to submit your app to the App Store or Mac App Store. Read Prepare for Uploading to ensure that you perform all the steps to streamline the app review process. It’s recommended that you submit the last archive you distribute for testing. The last build you test should be product quality and pass iTunes Connect validation tests. Depending on the testing method you choose, follow the steps in this chapter to submit your app.

If you use TestFlight to distribute your iOS app to testers (described in Beta Testing iOS Apps), submit the last build directly to App Review using iTunes Connect, as described in Submitting the App.

For iOS apps you distribute for testing using ad hoc provisioning (described in Distributing Your App Using Ad Hoc Provisioning), and Mac apps you distribute for testing using the team provisioning profile (described in Beta Testing Mac Apps), follow these steps:

  1. If necessary, validate the last archive you distributed for testing, described in Running iTunes Connect Validation Tests.

  2. For Mac apps, test the Mac Installer Package, as described in Testing the Mac Installer Package.

  3. Upload the archive, as described in Uploading Your App Using Xcode.

  4. Use iTunes Connect to submit your app to App Review, as described in Submitting the App.

If you want to create an archive just before uploading your app (for example, if you changed the build number), follow the steps in Creating an Archive before you validate the archive.

The first time you upload your app to iTunes Connect, Xcode creates the necessary distribution certificate and store provisioning profile for you.

About Store Provisioning Profiles

A store provisioning profile is a distribution provisioning profile that authorizes your app to use certain app services and ensures that you are the one submitting your app. A store provisioning profile contains a single App ID that matches one or more of your apps and a distribution certificate. You configure the App ID indirectly through Xcode to use certain app services. You enable and configure app services by setting entitlements and performing other configuration steps. Some entitlements are enabled for an App ID (a set of apps created by your team), and others are set in the Xcode project. When you submit your app to the store, Xcode signs the app bundle with the distribution certificate referenced in the store provisioning profile.

../Art/store_provisioning_2x.png

Prepare for Uploading

Before uploading your app to iTunes Connect, review the human interface and store guidelines, enter information in iTunes Connect, and verify your Xcode project settings.

Review Human Interface and Store Guidelines

To streamline the approval process, review the following guidelines and fix any problems and retest your app before continuing.

For more information on the app review process, go to App Review.

Enter Information in iTunes Connect

iTunes Connect is a web tool you use to enter information about your app for sale in the App Store or the Mac App Store. iTunes Connect stores all the metadata about your app including the versions and builds that you upload using Xcode. Before you upload your app, create an app record in iTunes Connect, as described in Creating an iTunes Connect Record for an App. Then enter all the required information, described in Viewing and Changing Your App’s Metadata.

Verify Your Xcode Project

Verify that your Xcode project is configured correctly:

  • Review your Xcode project configuration. Read Configuring Your Xcode Project for Distribution.

  • The bundle ID in the Xcode project, described in Setting the Bundle ID, should match the bundle ID you enter in iTunes Connect.

  • Use the same App ID to code sign your archive as you used for development and testing.

    If you don’t use any app services that require an explicit App ID, you can use the Xcode wildcard App ID. If you want to create a new App ID, read Registering App IDs. However, if you change your App ID, retest your app using the new App ID before uploading it to iTunes Connect.

  • Review the version number and build number settings, described in Setting the Version Number and Build String. iTunes Connect extracts its prerelease version number and build number from the binary.

  • To ensure that your app enables the key app services you want to use, review your App ID settings. Read Adding Capabilities.

For Mac apps, review these additional tasks:

Archiving and Validating Your App

Before you upload your app to iTunes Connect, you create a signed archive of your app and validate it. Test your final build before uploading it, and if you have not done so, test the archive again for regressions after validating it.

Follow these steps to archive and validate your app:

  1. Review the Archive scheme settings.

  2. Create an archive of your app.

  3. Validate the archive.

  4. If necessary, test your archive before uploading it.

Reviewing the Archive Scheme Settings

If necessary, review the Archive scheme settings to ensure that you don’t archive a debug version of your app.

To review the Archive scheme

  1. In the Xcode project editor, choose Product > Scheme > Edit Scheme to open the scheme editor.

  2. Click Archive in the column on the left.

    ../Art/6_archiveschemesettings_2x.png
  3. Choose Release from the Build Configuration pop-up menu, and click Close.

Creating an Archive

No matter what method you choose to distribute your app, create an archive first. Before creating the archive, build and run your app one more time to ensure that it’s the version you want to distribute. Immediately after creating the archive, validate it and fix any validation errors before continuing.

To create an archive

  1. In the Xcode project editor, select the project.

  2. From the Scheme toolbar menu, choose a scheme.

  3. Choose Product > Archive.

    The Archives organizer appears and displays the new archive.

Xcode runs preliminary validation tests when you create the archive. If a validate warning message appears in the project editor, fix the issue and create the archive again.

Running iTunes Connect Validation Tests

Immediately after creating the archive, upload your archive to iTunes Connect and run validation tests.

To validate an archive

  1. In the Archives organizer, select the archive.

  2. Click the Validate button.

  3. For Mac apps, select “Validate for the Mac App Store” as the validation method and click Next.

  4. In the dialog that appears, choose a team from the pop-up menu and click Choose.

    If necessary, Xcode creates a distribution certificate and distribution provisioning profile for you. The name of the distribution provisioning profile begins with the text XC:.

  5. In the dialog that appears, review the app, its entitlements, and provisioning profile, and click Validate.

    Xcode uploads the archive to iTunes Connect and iTunes Connect runs validation tests. If a dialog appears stating that no application record can be found, click Done, create an app record in iTunes Connect, and repeat these steps.

    ../Art/8_ios_review_dist_profile_2x.png
  6. Review validation issues that are found, if any, and click Done.

Fix any validation issues you find, create a new archive, and repeat these steps until there are no further issues. You can’t proceed until the archive passes all the validation tests.

Testing the Mac Installer Package

Before you submit your app to the Mac App Store, test the installation process to verify that your app installs correctly. Do this by saving the installer package to your disk and running a test using the installer command before submitting it.

Creating an Installer Package

You save an installer package to your disk by following similar steps as for validating and distributing your Mac app.

To create an installer package

  1. In the Archives organizer, select the archive.

  2. Click the Export button.

  3. Select “Export as a Mac Installer Package,” and click Next.

    ../Art/8_mac_export_installer_2x.png
  4. In the dialog that appears, choose a team from the pop-up menu and click Choose.

    If necessary, Xcode creates a distribution certificate and distribution provisioning profile for you. The name of the distribution provisioning profile begins with the text XC:.

  5. In the dialog that appears, review the app, its entitlements, and provisioning profile, and click Export.

  6. In the dialog that appears, enter a filename and choose a location, and click Export.

Testing the Installer Package

Don’t test the installation process by opening the package with the Installer app. Only the installer command verifies that your app will be installed correctly when it’s purchased from the Mac App Store.

To test your installer package, execute the following command in a Terminal window:

sudo installer -store -pkg path-to-package -target /

The output of the installer command should be similar to:

rpatel$ sudo installer -store -pkg ../Documents/TrackMix.pkg -target /
 
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
 
To proceed, enter your password, or type Ctrl-C to abort.
 
Password:
installer: Note: running installer as an admin user (instead of root) gives better Mac App Store fidelity
installer: TrackMix.pkg has valid signature for submission: 3rd Party Mac Developer Installer: Ravi Patel (7U3X8B3P5Z)
installer: Installation Check: Passed
installer: Volume Check: Passed
installer: Bundle com.example.rpatel.TrackMix will be installed to /Applications/TrackMix.app
installer: Starting install
installer: Install 0.0% complete
installer: Install 90.8% complete
installer: Install 100.0% complete
installer: Finished install
rpatel$

If the installer finds a bundle with the same bundle ID as the one it’s installing, it upgrades the existing app. Users can then install upgrades even if they have moved your app. If you have a copy of your app installed (for example, in your build products directory), you may want to remove it so that the installer installs your app in /Applications. Other options include archiving the existing version in a ZIP file or moving it to another volume and unmounting that volume.

Uploading Your App Using Xcode

Upload your code signed and provisioned app to iTunes Connect. This important step ensures that the upload comes directly from you and that only you grant permission for your app to use certain app services. Code signing your app or installer package prevents an attacker from uploading a modified version of your app—only someone with the private key for your distribution certificate can upload your app to iTunes Connect.

To upload an app to iTunes Connect

  1. In the Archives organizer, select the archive and click the “Submit to the App Store” button.

    ../Art/8_ios_archive_organizer_2x.png
  2. In the dialog that appears, choose a team from the pop-up menu and click Choose.

    If necessary, Xcode creates a distribution certificate and distribution provisioning profile for you. The name of the distribution provisioning profile begins with the text XC:.

  3. In the dialog that appears, review the app, its entitlements, and provisioning profile, and click Submit.

    Xcode uploads the archive to iTunes Connect and iTunes Connect runs validation tests. If a dialog appears stating that no application record can be found, click Done, create an app record in iTunes Connect, and repeat these steps.

  4. If issues are found, click Done and fix them before continuing.

  5. If no issues are found, click Submit to upload your app.

Xcode transmits the archive to Apple, where the binary is examined to determine whether it conforms to Apple guidelines. If the binary is rejected, correct the problems that were identified and upload a new binary. If you successfully upload your app, view the version and build of your app in iTunes Connect, as described in Viewing Binary Details. Later, use iTunes Connect to submit your app to App Review, as described in Submitting the App.

If you prefer to upload your binary using Application Loader, read Using Application Loader for how to use Application Loader for this step.

Recap

In this chapter, you learned how to submit your app to the store using Xcode. This chapter doesn’t cover the steps to distribute your app using iTunes Connect. To learn how to view the status of your app, read Viewing the Status of Your App.