Publishing to the App Store A Guide to Distributing Xamarin.iOS Applications Contents This article covers the following topics in detail: Before you Submit Configuring your Application in iTunes Connect Preparing for App Store Distribution Provisioning for Application Services Setting the Apps Icons and Launch Screens Creating and Installing a Distribution Profile Setting the Build Configuration for your Application Building and Submitting the Distributable Submitting Your App to Apple iTunes Connect Status Overview In order distribute applications to all iOS devices, Apple requires apps to be published through the App Store. This makes the 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 an App ID and selecting Entitlements. 2. Creating a Distribution Provisioning Profile. 3. Using this profile to build your application. 4. 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 Apple’s 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. Apple’s guidelines are available at: App Store Review Guidelines. A couple things to watch out for when submitting an app are: 1. Make sure the application’s description matches the functionality included in the app. 2. Test that the application doesn’t crash under normal usage. This includes usage on every iOS device you support. Apple also maintains a list of App Store submission tips. You can read these at Distributing on the App Store. Configuring your Application in iTunes Connect iTunes Connect is a suite of web based tools for, among other things, managing your iOS applications on the App Store. Your Xamarin.iOS application will need to be properly setup and configured in iTunes Connect before it can be submitted to Apple for review and ultimately, be released for sale or as a free app in the App Store. Do the following: 1. Verify that you have the proper agreements in place and up to date in the Agreements, Tax, and Banking section of iTunes Connect to release an iOS application for free or for sale. 2. Create a new iTunes Connect Record for the application and specify it's Display Name (as seen in the App Store). 3. Select a Sale Price or specify that the application will be released for free. 4. Provide an App Store Icon (iTunes Artwork) and screenshots or video of your application in action on the iOS devices it supports. 5. Provide a clear, succinct Description of the application including it's features and benefit to the end user. 6. Provide Categories, Sub Categories and Keywords to help the user find your app in the App Store. 7. Provide Contact and Support URLs to your website required by Apple. 8. Set your application's Rating, which is used by parental controls on the App Store. 9. Configure optional App Store technologies such as Game Center and In-App Purchase. For more details, please see our Configuring an App in iTunes Connect documentation. Preparing for App Store Distribution In order to publish an application to the App Store, you first need to build it for distribution, which involves many steps. The following sections covers everything required to prepare a Xamarin.iOS application for publication so it can be built and submit it to the App Store for review and release. Provisioning for Application Services Apple provides a selection of special Application Services, also called entitlements, that can be activated for your iOS application when you create a unique ID for it. Whether you are using custom entitlements or not, you'll still need to create a unique ID for your Xamarin.iOS application before it can be published on the App Store. Creating an App ID and optionally selecting entitlements involves the following steps using Apple's web based iOS Provisioning Portal: 1. Select Provisioning > Development. 2. Click the + button and provide a Name and Bundle ID for the new application. 3. Scroll to the bottom of the screen and select any App Services that will be required by your Xamarin.iOS application. 4. Click the Continue button and following the on screen instructions to create the new App ID. In addition to selecting and configuring the required Application Services when defining your App ID, you also need to configure the App ID and entitlements in your Xamarin.iOS project by editing both the Info.plist and Entitlements.plist files. Do the following in Xamarin StudioVisual Studio: 1. In the Solution Explorer, double-click the Info.plist file to open it for editing. 2. In the iOS Application Target section, fill in a name for your application and enter the Bundle Identifier that you created when you defined the App ID. 3. Save the changes to the Info.plist file. 4. In the Solution Explorer, double-click the Entitlements.plist file to open it for editing. 5. Select and configure and entitlements required for you Xamarin.iOS application so that they match the setup you did above when you defined the App ID. 6. Save the changes to the Entitlements.plist file. For detailed instructions, please see our Provisioning for Application Services documentation. Setting the Apps Icons and Launch Screens Before an iOS application will be accepted by Apple for inclusion in the App Store, it will require proper icons and launch screens for all of the iOS devices that it will be running on. You'll need to edit your application's Info.plist file in Xamarin StudioVisual Studio and fill in all of the required images in the Icons and Launch Images sections (or use a Universal Storyboard for the Launch Screen). For detailed instructions, please see our Application Icon and Launch Screens documentation. 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. Provisioning involves the following steps using Apple's web based iOS Provisioning Portal: 1. Select Provisioning > Distribution. 2. Click the + button and select the type of Distribution Profile that you want to create as App Store. 3. Select App ID from the dropdown list that you want to create a Distribution Profile for. 4. Select certificate required to sign the application. 5. Enter a Name for the new Distribution Profile and generating the profile. 6. Refreshing the list of available profiles in Xcode on the Xamarin Build Host's Mac. 7. Selecting the Distribution Provisioning Profile in Xamarin StudioVisual Studio for the App Store Build Configuration. For detailed instructions, please see our Creating a Distribution Profile and Selecting a Distribution Profile in a Xamarin.iOS Project documentation. Setting the Build Configuration for your Application By default, when you create a new Xamarin.iOS application in Visual Studio, Build Configurations are automatically created for both Ad Hoc and App Store deployment. Before doing the final build of your application that you will be submitting to Apple, there are a few modification that you will need to make to the base configuration. Do the following: 1. Right-click on the Project Name in the Solution Explorer and selection Properties to open them for editing. 2. Select iOS Build and AppStore from the Configuration dropdown: 3. If you have a specific iOS version that you are targeting, you can select it from the SDK version dropdown list, else leave this value at default setting. 4. Linking reduces the overall size of your application's distributable by stripping out unused Methods, Properties, Classes, etc. and in most cases should be left to the default value of Link SDK assemblies only. In some situations, such as when using some specific 3rd party libraries, you may be forced to set this value to Don't link to keep needed element from being removed. 5. The Optimize PNG image files for iOS checkbox should be checked as this will help to further decrease your application's deliverable size. 6. Debugging should not be enabled as it will make the build unnecessarily larger. 7. Click on the Advanced tab: 8. If your Xamarin.iOS application is targeting iOS 8 and 64 bit iOS devices, you'll need to select one of the device architectures that supports ARM64. For more information on building for 64 bit iOS devices, please see the Enabling 64 Bit Builds of Xamarin.iOS Apps section of our 32/64 bit Platform Considerations documentation. 9. You may wish to optionally use the LLVM compiler which creates smaller and faster code, however it will take longer to compile. 10. Based on your application's needs, you may also wish to adjust the type of Garbage Collection being used and setup for Internationalization. 11. Save your changes to the build configuration. Building the Distributable With your Xamarin.IOS application properly configured, you are now ready to do the final distribution build that you will be submitting to Apple for review and release. Do the following: Build your Archive 1. Select the Release | Device configuration in Xamarin Studio: 2. From the Build menu, select Archive for Publishing 3. Once the archive has been created, the Archives view will be displayed: Sign and Distribute your App Each time you build your application for Archive, it will automatically open the Archives View, displaying all archived projects; grouped by solution. By default this view only shows the current, open solution. To see all solutions that have archives, click on the Show all archives option. 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. To sign your app and prepare it for distribution: 1. Select the Sign and Distribute..., illustrated below: 2. This will open the publishing wizard. Select the App Store distribution channel to create a package, and open Application Loader: 3. On the Provisioning Profile screen, Select your signing identity and corresponding provisioning profile, or re-sign with another identity: 4. Verify the details of your package, and click Publish to save your .ipa package: 5. Once your .ipa has been saved, your App is ready to be uploaded to iTunes Connect via the Application Loader: The Xamarin plugin for Visual Studio does not currently support the Archiving workflow for publishing iOS applications to the App Store. As a result, you have two options available when publishing an iOS application from Visual Studio: Option 1: Upload an IPA created via the Build Adhoc IPA command. Option 2: Upload a zipped .app bundle. Both options will be discussed in detail below. Build an IPA via the Build Adhoc IPA Command For this option, we will be building an IPA like we are going to be doing an Ad Hoc or Enterprise Distribution. However, we will be signing the API using the App Store provisioning profile we created above. Do the following: In the Solution Explorer, right-click the Xamarin.iOS project name and select Properties to open them for editing: Select iOS Bundle Signing and change the to an App Store provisioning profile: Select iOS IPA Options and select Ad-Hoc from the Configuration dropdown list: You can optionally specify a Package Name for the IPA, if not specified it will have the same name as the Xamarin.iOS project. Save your changes to the Project Properties. Select Ad Hoc from the Xamarin Studio Build Configuration dropdown: Build the project to create the IPA package. The IPA will be build in the Bin > iOS Device > Ad Hoc folder: Build a .app Bundle for Zipping For this option, we will be building a release version of the iOS App and again signing it App Store provisioning profile we created above. Later, we will zip this app's bundle and publish it on the App Store. Do the following: 1. In the Solution Explorer, right-click the Xamarin.iOS project name and select Properties to open them for editing: 2. Double-check that the provisioning profile in iOS Bundle Signing is an AppStore provisioning profile: 3. Pick the AppStore, iPhone build configuration: 4. Rebuild the project, then press the Start button to perform the remote build step and attempt to deploy to device. Note that the deploy will fail because the provisioning profile is not intended for this usage. 5. Switch to the Mac Build Host. 6. Start the Terminal application. 7. Enter the following command (replacing {project-guid} with the actual GUID of your iOS project): cd ~/Library/Caches/Xamarin/mtbs/builds/YourAppName/{projectguid}/output/Release/iPhone/YourAppName.app 8. Zip up the .app bundle by running the following command: zip -r YourAppName.app.zip YourAppName.app With your distribution build created and archived, you are now ready to submit your application to iTunes Connect. Submitting Your App to Apple Note: Apple have recently changed their verification process for iOS applications, and may reject apps with the iTunesMetadata.plist included in the IPA. If you encounter the error ERROR: ERROR ITMS-90047: "Disallowed paths ( "iTunesMetadata.plist" ) found at: Payload/iPhoneApp1.app" the workaround describedhere should resolve the issue. With the distribution build completed, you are ready to submit your iOS application to Apple for review and release on the App Store. No matter which of the two options you chose above to build your application distributable, you need to move to the Mac Build Host to submit your application to Apple for review using the Application Loader app. You can download a copy of the Application Loader from here. The archive workflow in Xamarin Studio will open Application Loader automatically,once you have saved the .ipa 1. Select Deliver Your App and click the Choose button: 2. Select the zip or IPA file you created above and click the OK button. 3. The Application Loader will validate the file: 4. Click the Next button and the application will be validated against the App Store: 5. Click the Send button to send the application to Apple for review. 6. The Application Loader will inform you when the file has been successfully uploaded. iTunes Connect Status If you log back into iTunes Connect and select your application from the list of available apps, the status in iTunes Connect should now show that it is Waiting for Review (it may temporarilyread Upload Received while it is processed): 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 StudioVisual Studio to create a distribution build. Finally, it showed you how to use iTunes Connect and the Xcode ArchiveApplication Loader Tool to submit an application to the App Store.
© Copyright 2024