Submitting Your App

The final distribution step is to submit your code signed and provisioned app to the store. This important step ensures that the submission comes directly from you and that only you grant permission for your app to use key technologies and 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.

Follow these steps to submit your app:

  1. Create a distribution certificate.

  2. Create a store distribution provisioning profile.

  3. Archive and validate your app.

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

  5. Submit your app using Xcode or Application Loader.

For Mac apps, select Mac App Store as the signing method during development if you intend to distribute your app on the Mac App Store, as described in “Choosing a Signing Identity for Mac Apps.” Mac apps need a distribution provisioning profile only if the app uses key technologies and services, described in “Adding Capabilities,” with the exception of App Sandbox.

About Store Provisioning Profiles

A store provisioning profile is a distribution provisioning profile that authorizes your app to use certain technologies and services, and ensures that your app is submitted by you. A store distribution provisioning profile contains a single App ID that matches one or more of your apps, and a distribution certificate. For iOS apps, you need a store provisioning profile to submit your app. For Mac apps, if you use technologies and services that require provisioning, you need a store provisioning profile. If you don’t use these technologies and services, you can use the distribution certificate to sign your app.

../Art/store_provisioning_2x.png

Configure the App ID before you create the store provisioning profile. You enable and configure technologies for an app 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, you select the distribution certificate contained in your store provisioning profile.

Before You Begin

Before continuing, review the tasks that should be complete before you submit 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 technologies and services you want to use, review your App ID settings. Read “Adding Capabilities.”

../Art/checkbox_checked_2x.png

For iOS apps, beta test your app on a variety of OS versions and devices. Read “Beta Testing Your iOS App.”

../Art/checkbox_checked_2x.png

Create an app record in iTunes Connect, as described in “Creating an App Record.” To validate or submit your app, the app record needs to be in the “Waiting for Upload” or later state.

Use the same App ID that you used for development and testing for submitting your app to the store. If you don’t use any technologies and 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 submitting it to the store.

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

Creating Distribution Certificates

You must create a store distribution certificate before you can create a store provisioning profile. If you did not create a distribution certificate during development, you can create it now using Accounts preferences in Xcode, as described in “Requesting Signing Identities.” For iOS apps, request an iOS Distribution certificate. For Mac apps, request both a Mac App Distribution and Mac Installer Distribution certificate.

Creating Store Provisioning Profiles

Before submitting iOS apps to the store, you must provision them using a distribution provisioning profile. For Mac apps, if you don’t use any key technologies and services that require provisioning (you didn’t need a provisioning profile for development), you can skip this step. You don’t select any devices to create a store provisioning profile.

bullet
To create a store provisioning profile
  1. In Certificates, Identifiers & Profiles, select Provisioning Profiles.

  2. Click the Add button (+) in the upper-right corner.

  3. Select App Store for iOS apps or Mac App Store for Mac apps as the distribution method, and click Continue.

    The screenshot below shows App Store selected for an iOS app.

    ../Art/8_ios_createdistributionprofile_1_2x.png
  4. Choose the App ID you used for development (the app ID that matches your bundle ID) from the App ID pop-up menu, and click Continue.

    If you used a team provisioning profile during development and the menu contains only the Xcode Wildcard App ID, select it. If the menu contains an Xcode-managed explicit App ID (it begins with “Xcode” and contains your bundle ID), select that App ID. If you created your own App ID, select that one.

    ../Art/8_ios_createdistributionprofile_2_2x.png
  5. Select your distribution certificate, and click Continue.

    A store provisioning profile contains a single distribution certificate.

  6. Enter a profile name, and click Generate.

    Wait while Member Center generates the provisioning profile.

  7. Click Done.

In Xcode, refresh the provisioning profiles to download the ad hoc provisioning profile, as described in “Refreshing Provisioning Profiles in Xcode.” The store provisioning profile should now appear in the Provisioning Profiles table in the view details dialog in Accounts preferences.

Archiving and Validating Your App

Just before you submit your app to the store, 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 submitting 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 submitting 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.

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

bullet
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 some validation tests when you create the archive. If a validate warning message appear in the project editor, fix the issue and create the archive again.

Running iTunes Connect Validation Tests

Immediately after creating the archive, validate it and fix any validation errors before continuing.

bullet
To validate an archive
  1. In the Archives organizer, select the archive.

  2. Click the Validate button.

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

  4. Enter your iTunes Connect credentials, and click Next.

    If a dialog appears stating that no application record can be found, create an app record in iTunes Connect before continuing.

  5. Choose the store provisioning profile or, for some Mac apps, the distribution certificate you created in a previous step from the Provisioning Profile pop-up menu, and click Validate.

    iTunes Connect runs validation tests.

    ../Art/8_validatearchive_2x.png
  6. Review validation issues found, if any, and click Finish.

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.

Troubleshooting

After you enter your iTunes Connect credentials, if a dialog appears stating that no application record can be found, create an app record in iTunes Connect before validating your app. To learn how to create an app record, read “Creating an App Record.”

If your provisioning profile or Mac distribution certificate doesn’t appear in the Provisioning Profile menu when you validate the archive, refresh the provisioning profiles, as described in “Refreshing Provisioning Profiles in Xcode.”

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.

bullet
To create an installer package
  1. In the Archives organizer, select the archive.

  2. Click the Distribute button.

  3. Select “Export as” for the distribution method, Mac Installer Package as the file format, and click Next.

    ../Art/8_mac_export_installer_2x.png../Art/8_mac_export_installer_2x.png
  4. Choose the store provisioning profile or the distribution certificate you created in a previous step from the “Profile or Signing Identity” pop-up menu, and click Export.

    If you’re an individual, the name of the Mac Installer Distribution certificate is your name.

  5. Enter a filename and choose a location from the dialog, and click Save.

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.

Submitting Your App Using Xcode

Submitting your app to the App Store or Mac App Store is just one of several types of distribution methods you can choose. To submit your app using Xcode, select an archive and click the Distribute button in the Archives organizer. In the first dialog that appears, you select the store distribution method. The following dialogs and choices are slightly different 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.

Submitting Your iOS App

For iOS apps, you select the “Submit to the iOS App Store” option when distributing your app.

bullet
To submit an archive to the App Store
  1. In the Archives organizer, select the archive.

  2. Click the Distribute button.

  3. Select “Submit to the iOS App Store,” and click Next.

    ../Art/8_createappstorepkg_2x.png
  4. Enter your iTunes Connect credentials, and click Next.

  5. Choose the store provisioning profile you created in a previous step from the Provisioning Profile pop-up menu, and click Submit.

    iTunes Connect runs validation tests.

    ../Art/8_selectdistributioncert_2x.png
  6. If issues are found, click Cancel and fix them before continuing.

  7. If no issues are found, click Submit to submit 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 resubmit it.

If you successfully submit your app, view the status of your app in iTunes Connect, as described in “Viewing the Status of Your App.” After submitting your binary, Apple may discover other problems with your app’s metadata in iTunes Connect that need to be fixed before Apple can review your app. If no problems are found, the status of the app changes to “Waiting For Review.” To resolve any problems with your app record, refer to iTunes Connect Developer Guide.

Submitting Your Mac App

For Mac apps, you select the “Submit to the Mac App Store” option and choose the store provisioning profile or distribution certificate. If your app uses key technologies and services, choose a store provisioning profile.

bullet
To submit an archive to the Mac App Store
  1. In the Archives organizer, select the archive.

  2. Click the Distribute button.

  3. Select “Submit to the Mac App Store,” and click Next.

    ../Art/8_mac_createappstorepkg_2x.png
  4. Enter your iTunes Connect credentials, and click Next.

  5. Choose the store provisioning profile or the distribution certificate you created in a previous step, and click Submit.

    If you use a store provisioning profile, choose the distribution certificate in your store provisioning profile. Choose the signing identity that contains your team name. If you’re an individual developer, your team name is the same as your name.

    ../Art/8_selectdistributioncert_mac_2x.png../Art/8_selectdistributioncert_mac_2x.png

    iTunes Connect runs validation tests.

  6. If issues are found, click Cancel and fix them before continuing.

  7. If no issues are found, click Submit to submit your app.

Xcode transmits the archive to Apple, where it’s examined to determine whether it conforms to the app guidelines. If the app is rejected, correct the problems that were brought up during app approval and resubmit it.

If you successfully submit your app, view the status of your app in iTunes Connect, as described in “Viewing the Status of Your App.” After submitting your binary, Apple may discover other problems with your app’s metadata in iTunes Connect that need to be fixed before Apple can review your app. If no problems are found, the status of the app changes to “Waiting For Review.” To resolve any problems with your app record, refer to iTunes Connect Developer Guide.

Troubleshooting

After you enter your iTunes Connect credentials, if a dialog appears stating that no application record can be found, create an app record in iTunes Connect before validating your app. To learn how to create an app record, read “Creating an App Record.”

If your provisioning profile or, for some Mac apps, distribution certificate doesn’t appear in the Provisioning Profile menu when you submit the archive, refresh the provisioning profiles, as described in “Refreshing Provisioning Profiles in Xcode.”

Recap

In this chapter, you learned how to submit your app to the store using Xcode. This chapter doesn’t cover the approval process. To learn how to view the status of your app, read “Viewing the Status of Your App.”