Sunteți pe pagina 1din 26

Publishing to the App Store

A Guide to Distributing Xamarin.iOS Applications

Overview
In order distribute applications to all iOS devices, Apple requires apps to be published through the
iTunes App Store. This makes the iTunes App Store the one-stop shopping location for iOS
applications, as you are probably well aware. With over 500,000 applications in the store, developers
of many types of applications have been able to capitalize on the massive success of this single
point of distribution. The App Store is a turnkey solution, offering app developers both distribution
and payment systems.
The process of submitting an application to the App Store involves:
1. Creating a Distribution Provisioning Profile.
2. Using this profile to build your application.
3. Submitting your application through iTunes Connect.
In this article we will cover all the steps needed to provision, build, and submit an application for App
Store distribution.

Before you Submit


The first thing that happens to your application after you submit it for publication to the App Store is
for it to go through a review process by Apple to insure it meets Apples guidelines for quality and
content. If your application fails to meet these guidelines, Apple will reject it, at which time you will
need to address the non-conformance cited by Apple, and then resubmit. Therefore, you stand the
best chance of making it through Apple review by familiarizing yourself with these guidelines and
trying to adapt your application to them. Apples guidelines are available at:
https://developer.apple.com/appstore/resources/approval/guidelines.html.
A couple things to watch out for when submitting an app are:
1. Make sure the applications description matches the functionality included in the app.
2. Test that the application doesnt crash under normal usage. This includes usage on every
device you support.
Apple also maintains a list of App Store submission tips. You can read these at
https://developer.apple.com/appstore/resources/submission/tips.html.
Additionally, to help with beta testing, Xamarin Studio provides integrated support for TestFlight. For
information about how to use TestFlight, see testflightapp.com and
http://docs.xamarin.com/ios/tutorials/TestFlight_Support.

Building for App Store Distribution


In order to publish an application to the App Store, you first need to build it for distribution. Building
for distribution involves creating a distribution provisioning profile and then using that to create a

distribution build. Lets go through all the steps involved to create a distribution build.

Creating and Installing a Distribution Profile


iOS uses provisioning profiles to control how a particular application build can be deployed. These
are files that contain information about the certificate used to sign an app, the Application ID, and
where the app can be installed. For development and ad-hoc distribution, the provisioning profile
also includes the list of allowed devices to which you can deploy the app. However, for App Store
distribution, only certificate and app ID information are included, since the only mechanism for public
distribution is through the App Store.
iOS provisioning profiles are managed through a web-based tool called the iOS Provisioning Portal.
To access the portal, log in to the iOS Dev Center at developer.apple.com and click Member Center
from the links at the top. The Member Center area looks like this:

For App Store distribution, you need to create an Application ID and a distribution profile for the
application in the provisioning portal. Youll associate the distribution profile with the Application ID
you create.
Follow these steps to create an Application ID, a distribution profile, and a production certificate:
1. In the Member Center, select Certificates, Identifiers, and Profiles, then select Identifiers in the
left-hand column under "iOS Apps". This will show a list of all identifiers associated with your
developer or your team account. Click the "+" in the top right to create a new ID.

2. Enter a Description, enabled Services, Prefix/Bundle Seed ID (use the Team Bundle Seed ID),
and Suffix/Bundle Identifier, and then click Submit. An example for an application called
MonkeySpace is shown below:

Opening the App ID from the list of IDs should bright up the following information:

Next, select Provisioning Profiles in the left-hand pane. This will bring up a list of all the
Provisioning profiles associated with your developer account or your team account. Click the
"+" in the top right to add a new profile
In the first panel, choose App Store under Distribution as as the Type for your Provisioning
Profile:

Next, select the App ID created for this application, and then click Submit:

Select a valid Distribution Certificate:

Finally, name the Profile something that makes sense:

The completed iOS Distribution Provisioning Profile screen for the MonkeySpace app is
shown. The completed provisioning profile can be downloaded and installed when it is created
by clicking the download button in the screenshot shown below:

Additionally the profile can be downloaded any time by opening it from the provisioning profile
list:

After your provisioning profile has downloaded, drag-drop the downloaded profile file onto the
Xcode icon in the Dock to install it.

If you do not yet have a Production Certificate associated with your account, you need to
generate one. Navigate to Certificates, and click the "+" to generate a new Certificate.
For the Type, select App Store and Ad Hoc:

The Portal will provide instructions for how to generate a Certificate. Open Keychain Access;
from the main menu, choose Certificate Assistant... and Request Certificate from a Certificate
Authority...:

Fill in your information and select the "Saved to disk" option:

Upload the Certificate Signing Request:

Download the Certificate. It will be automatically added to your Keychain:

With the production provisioning profile created and installed, you can now use it to create a
distribution build for App Store publication, as shown in the next section.

Creating a Distribution Build Configuration


Now lets build a Xamarin.iOS application that can be published to the App Store. First, youll need to
add a new build configuration to the Xamarin Studio solution. This new configuration will use the
distribution profile you created and installed in the previous section to sign the application for App
Store distribution.

Adding the Build Configuration


Follow these steps to create the build configuration:
1. Double-click on the solution in the Solution Explorer to display the Solution Options dialog.
2. Select Build > Configurations in the left-hand pane.
3. Under the General tab, select Add.
4. In the New Configuration dialog, give the configuration a name, such as AppStore, and then
select iPhone as the Platform, (iPhone actually means iOS device in this context) as shown
below:

5. Click OK in the Solution

Options

dialog.

Configuring the Build Configuration for your Application


1. Back in the Solution Explorer, right-click the project and then select Options.
2. Select Build > iOS Build and then choose the newly created AppStore configuration. Set any
additional build settings your application may need for the AppStore configuration, such as
Additional mtouch arguments, in this dialog:

3. Select iOS Bundle Signing in the left-hand pane.


4. For the AppStore configuration, set the Identity to Distribution

(Automatic)

and then select the

Provisioning profile

you installed earlier, as shown below for the LiveDemo app:

5. Select iOS Application in the left-hand pane.


6. On the Summary tab, under the iOS Application Target section, set the Application name,
Identifier, and the Version and Devices. The Identifier must be the same value that was set for
the Bundle Identifier when you created the provisioning profile, as shown below for the
LiveDemo app:

7. For an application distributed in the App Store, you should also include application icons. See
the document Working with Images for more information.
8. Click OK in the Project Options dialog.

9. In Xamarin Studio, set the Build Target drop-down list to the newly created AppStore|iPhone
configuration in the top toolbar, as shown below:

10. Select Build > Build All from the main menu to build the application. You should always
ensure that the application builds without errors before creating an Archive to distribute.
If the application builds successfully you are ready to upload it to the App Store, which is the topic of
the next section.

Publishing your Application to the App Store


Applications are published to the App Store by using the iTunes Connect website along with the
Xcode Archive Tool, which is included with the iOS SDK. iTunes Connect is available at
https://itunesconnect.apple.com.
Apple offers an integrated build and deployment mechanism in Xcode called Archiving. Xamarin
Studio 3.0 can integrate with this feature to simplify the deployment process.
Some of the advantages of deploying via Build & Archive:
1. App can be validated before uploading.
2. Crash reports can be symbolicated for that release (if the corresponding Archive has been
saved).
Build & Archive can be used to:
1. Deploy to the App Store.
2. Build for Ad-hoc Distribution.
3. Build for Enterprise Deployment.
4. Export for later use.
This section is going to explain how to deploy to the App Store using the Xcode Organizers Archive
feature.
Before starting, you should have a distribution certificate (either Deployment, Enterprise or Ad-hoc)
from the iOS Provisioning Portal. Review the document Creating and Installing a Distribution Profile.

iTunes Connect

To deploy an application to the App Store, it must be configured in iTunes Connect (if you are
building for Ad-hoc or Enterprise deployment this step can be skipped). See the Creating Your App
Record in iTunes Connect for instructions. Once the application has been set-up, the application
page will appear as shown:

Press the Ready

to Upload Binary

button, and progress through the questions.

The final screen indicates that iTunes Connect is ready for the application bundle to be uploaded.
The text on the screen suggests using Application Loader, however the bundle can also be uploaded
via the Archive tool.

When the status is Waiting

for Upload

the application binary can be deployed via the Archive tool.

The process to deploy an app using the Archive tool is discussed in the following sections.

Xamarin Studio
A Distribution profile should be used, otherwise the tool cant sign the code and it will not be able to
be installed onto non-test devices.
Xamarin Studio will attempt to choose the correct Provisioning profile based on the Bundle ID and
the developers Identity; however you can manually select a specific Provisioning profile via the
menu item Project > Options > iPhone Bundle Signing, as shown here:

To archive the current application, select Xamarin Studios Build

> Archive

menu item.

The status bar will display the build progress. When complete, the Archives tab will be displayed.
The Archives tab displays a list of archived applications. Click on an app to see application details
and the individual archives that have been built. Comments can be added to the archive (eg. make a
note of why the archive was created, such as for a beta test release, or an App Store production
deployment). Comments are useful because it is a good idea to keep archives (especially those
released to the App Store or an Enterprise deployment) because it will allow you to symbolicate.

Once the archive has been created in Xamarin Studio, switch to Xcode for deployment options.

Xcode Organizer
Start Xcode and then open the Organizer from the Window menu.

In the Organizer, choose the Archives tab. This screen shows the same list of applications on the left
as the Archives tab in Xamarin Studio, and provides options to validate and distribute an archive:

The following steps apply to both validation and distribution (except where noted). Both buttons start
a wizard that guides you through the process. The first step is to choose which type of distribution:

For App Store submissions Xcode needs to login to iTunes Connect. Enter your Apple ID and
password:

Xcode retrieves a list of applications configured in iTunes Connect with a status of Waiting for
Binary. Choose the correct application from the list:

Xcode will then proceed to upload the application:

Validation
If you had chosen Validate then this is the result you hope to see:

Distribution
If you are in the process of distributing your app, it will then be uploaded to iTunes Connect:

Once the upload is complete, this message will appear to confirm that the application submission

has been successful and is now in the queue for review:

Now you just wait for Apples review team to approve your application and publish it on the App
Store!

iTunes Connect
If you chose to distribute your app, the status in iTunes Connect should now show that it is Waiting
for Review (it may temporarily read Upload Received while it is processed):

Subsequent versions
When new versions of an application are built and archived they will be added to the list in the
Archives tab. Adding a comment to each archive will help keep track of what each bundle was for.
This screenshot shows the archive tab after a subsequent build has been archived:

It is recommended that archives deployed to customers (either App Store or Enterprise


deployments) are kept, so that any debug information that is generated can be symbolicated at a
later date.

Errors
If there is a problem with the provisioning profiles on your computer the following message will
appear during the validation or distribution process. Use the buttons to update your identity and
provisioning profiles, or visit the iOS Provisioning Portal directly to download the correct certificates
and provisioning profiles.

Summary
This article presented a step-by-step guide to configuring, building, and submitting an application for
App Store publication. First, it covered the steps needed to create and install a distribution
provisioning profile. Next, it walked through how to use Xamarin Studio to create a distribution build.
Finally, it showed you how to use iTunes Connect and the Xcode Archive Tool to submit an
application to the App Store.

S-ar putea să vă placă și