Submitting Your App to the Store

The next distribution step is to submit your code signed and provisioned app to the App Store or Mac App Store. This important step ensures that the submission 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 submitting a modified version of your app to the store—only someone with the private key for your distribution certificate can submit your app to the store.

Use Xcode to upload archives to iTunes Connect, and use iTunes Connect to submit them to the store. Follow these steps to upload your app to iTunes Connect:

  1. Archive and validate your app.

  2. For Mac apps, test the Mac Installer Package.

  3. Upload your app using Xcode or Application Loader.

When you use Xcode to upload your app, Xcode creates the necessary distribution certificate and store provisioning profile for you. Later, when you are ready to submit the upload to the store for approval, read Submitting the App in iTunes Connect Developer Guide.

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

Before You Begin

Before continuing, review the tasks that should be complete before you upload your first binary:

Task

../Art/checkbox_checked_2x.png

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

../Art/checkbox_checked_2x.png

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

../Art/checkbox_checked_2x.png

For iOS apps, optionally beta test your app on a variety of OS versions and devices using ad hoc provisioning profiles. Read Distributing Your Beta App Using Ad Hoc Provisioning.

../Art/checkbox_checked_2x.png

Create an app record in iTunes Connect, as described in Creating an App Record.

Use the same App ID that you used for development and testing for uploading your app to the store. If you don’t use any app services, described in Adding Capabilities, 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 the store.

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

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

Archiving and Validating Your App

Just before you upload your app to iTunes Connect, you create a signed archive of your app and validate it. It’s recommended that you submit the last archive you distributed for final testing. Test your final build before uploading it to the store, 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 OK.

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

Uploading your app to the App Store or Mac App Store is just one of several types of distribution methods you can choose. To upload your app using Xcode, select an archive and click the Submit button in the Archives organizer. The following dialogs and choices are the same for iOS and Mac apps.

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

To upload an app to iTunes Connect

  1. In the Archives organizer, select the archive.

  2. Click the Submit button.

    ../Art/8_ios_archive_organizer_2x.png
  3. 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:.

  4. 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.

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

  6. 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 the app guidelines. If the binary is rejected, correct the problems that were brought up during app approval and upload a new binary.

Submitting Your App

If you successfully upload your app, view the status of your app in iTunes Connect, as described in Viewing the Status of Your App.

For iOS apps, use iTunes Connect to do one of the following:

For Mac apps, use iTunes Connect to submit your app to App Store review. For how to start the review process, read Submitting the App in iTunes Connect Developer Guide.

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.