Switch to a different documentation area.

Xamarin - Documentation

iOS

change platform

  1. Xamarin
  2. iOS
  3. Getting Started
  4. Installation

Installation

Installing and Configuring MonoTouch

Brief

This tutorial illustrates the installation paths for purchased and evaluation copies of MonoTouch, as well as the steps required to provision an iOS device for development.

Related Articles:

Introduction to MonoTouch

Hello, iPhone

Related Apple Documentation:

Creating Development Provisioning Profiles

Provisioning Using Organizer

Provisioning Using Portal

Overview

In this tutorial, we’ll highlight the steps we will need to finish and the components we will need to use to complete an installation of MonoTouch. Continuing to work in our MonoTouch development environment, we’ll walk through the actions required to provision an iOS device. By the end of this article, we should have a complete MonoTouch installation with a development device that’s set up and available to receive our application for deployment.

Required components

Before you can use MonoTouch, there are a few components you need to install. It is important that you install these requirements in the right order.

  1. Download and install Xcode 4 from the Apple website. This download is around 4.1GB.

  2. Download and install the "Latest Stable Version" of Mono framework for Mac OS X - Intel Runtime.

  3. Download and install the latest MonoDevelop IDE.

  4. Download and install the MonoTouch evaluation. Just enter you e-mail address at the bottom of the page to get the download started. As we’ll see in the next section, if you’ve purchased MonoTouch, please enter your activation/upgrade code to download the full version from the MonoTouch Activation page.

Installing a purchased copy

If you’ve downloaded a purchased copy of MonoTouch, you will need to activate it before proceeding. Download the full version of MonoTouch by opening http://activation.monotouch.netin a browser. Enter the activation code, and then click Download Mac OS X Package. If you do not have network access from your computer, you can perform an offline activation. Once you complete your activation, you can proceed with the installation. If you have a network connection, start the installation, and then fill in the activation form below:

Installation1.png

You must provide your email address so that we can resolve any activation problems, send you lost keys, and handle your support inquiries.

Setting up Development Devices

Now that we have successfully activated our installation of MonoTouch, let’s take a look at how to provision the device so we can develop and test a MonoTouch application:

  • Obtaining an iOS Development Certificate
  • Provisioning a Development Device
  • Adding a Device

Obtaining an iOS Development Certificate

Apple checks for encrypted signatures to enforce control over the devices to which we are allowed to distribute. Creating this signature starts with the creation of a Certificate Signing Request (CSR) on your local machine via the Keychain Access application.

Generating a Certificate Signing Request

In Finder, navigate to Applications > Utilities, and then launch the Keychain Access.app application:


keychain_access_plain.png

In the top menu bar, navigate to the Keychain Access > Certificate Assistant menu, and then select Request a Certificate From a Certificate Authority…:

request_certificate_from_authority.png

In the User Email Address field, provide the same email address you submitted when you registered for the iOS Developer Program, and then enter the appropriate value in the Common Name field. Choose to save the certificate locally by clicking Saved to Disk, then click Continue:

cert_assistant_info.png

Save the .certSigningRequest file to a location on the file system:

cert_assistant_save.png

Submitting a Certificate Signing Request

After creating the CSR, open a web browser and log in to the iOS Provisioning Portal, then navigate to the Certificate Manager by clicking Certificates > Development. Click Request Certificate in the Current Development Certificates section:

dev_portal_certificates.png

Click Choose File, then navigate to and upload the .certSigningRequest file we created in the previous section.

dev_portal_choose_csr.png

Click Submit (in the bottom right of the page) to upload the request file:

dev_portal_submit_csr.png

This brings us back to the Development Certificate Manager, where we’ll see a note in the Status column for our certificate request:

dev_portal_csr_status.png

You may have to wait until the status on the request proceeds from Pending Issuance to Issued. This may take a few minutes.

Importing a Development Certificate

Once the certificate request has been issued, download the development certificate by clicking Download in the Action column:

dev_portal_cert_download.png

Double-click the resulting .cer file and the KeyChain Access application will auto-import the development certificate:

keychain_access_imported.png

Note: The development certificates and associated keys are a critical piece of information for you as an iOS developer. They establish your identity with Apple and are used to associate you to a given device/profile for development. Losing this information can be incredibly disruptive, as it will require you to revoke your existing certificate and re-provision any associated devices, including those registered for ad-hoc deployment.

Provisioning for Development

Now that we’ve established your identity with Apple and have a Development Certificate, we should set up appropriate profiles so you can sign your applications.

Setting up Provisioning Profiles

By default, creating a Development Certificate will also create an iOS Team Provisioning Profile against the wildcard App ID. We can view this profile and add additional profiles by returning to the iOS Provisioning Portal and navigating to Provisioning > Development:

dev_portal_dev_profile.png

For now, we will use the default team profile to set up our development device; however, you can set up additional profiles by using the instructions you will find here.

Adding a Device

We’ve finished with registration now and we can begin adding devices. Devices are added either via Xcode (Automatic Provisioning) or by using the iOS Provisioning Portal (Manual Provisioning). In this tutorial, we’ll use Automatic Provisioning with Xcode.

First, plug in a USB data cable to the iOS device. Open Xcode by navigating to the /Developer/Applications folder in Finder, and then launching Xcode.app. Now open the Xcode Organizer by navigating to Windows > Organizer:

xcode_organizer.png

Using automatic provisioning

In Organizer, click on your iOS device in the Devices section on the left pane. In the device information screen, click Use for Development:

xcode_organizer_auto_provision.png

Provide the appropriate Apple ID and password for your developer account, and then click Log in:

xcode_organizer_autoprovision_login.png

We’ve set up our device and now we can deploy our application to it. The installation is complete.

Summary

That’s it! Everything should be good to go. Head on over to the Hello, iPhone tutorial to build your first iOS application!