Building an iOS App

Prerequisites

Before getting started, you are required to:

Types of Build

In Monaca, iOS app has three types of build: debug version, test version and release version. The differences between these types of build are as follows:

Types of Build Description Requirement Installation
Debug Build Building the app for installing on development device(s)
  • Development Certificate
  • Development Provisioning Profile
Ad Hoc Build Building the app for installing on a limited group of devices
  • Production Certificate
  • Distribution (Ad Hoc) Provisioning Profile
  • iTune
  • QR Code
Release Build Building the app for distribution in App Store
  • Production Certificate
  • Distribution (App Store) Provisioning Profile
  • App Store

Note

Ad Hoc distribution is a way to distribute your applications without going through the App Store. Currently, up to 100 applications which are built by using Ad Hoc provisioning profile can be shared with other iOS devices through Ad Hoc distribution. However, the application distribution from the developer organization will be limited to the development stakeholders.

Step 1: Configure iOS App in Monaca

Configure iOS App Settings

  1. From the Monaca Cloud IDE menu, go to Config ‣ iOS App Settings.
  2. Fill in the necessary information of your app:
Application Name a name representing your app publicly such as in the Market.
App ID a unique ID representing your app. It is recommended to use reverse-domain style (for example, mobi.monaca.appname) for App ID. Only alphanumeric characters and periods (at least one period must be used) are allowed. Each segment separated by a period should begin with an alphabetic character.
Version Number a number representing the version of your app which will be required when uploading (publishing process) your application via iTune Connect later. It needs 3 numbers separated by dots (for example, 1.10.2). Each number should be in [0-99].
../../../../../_images/159.png

Warning

The App ID (set in Monaca App Settings) cannot contain asterisk (*); otherwise, the build will fail. This App ID must be the same as the explicit App ID you will register (or have registered) in iOS Dev Center. Read more on Register App ID.

  1. After finishing the configurations, click Save.

Note

Currently, when you update either iOS’s App ID or Android’s Package Name, both of them will change. In other words, they are configured to be the same. However, it is possible to make them different. Please refer to How to make iOS’s App ID and Android’s Package Name differently..

Configure iOS Build Settings

  1. From the Monaca Cloud IDE menu, go to Config ‣ iOS Build Settings.
../../../../../_images/242.png
  1. You need to create a new private key or import an existing one. To create a new private key, click on Generate Key and CSR button and fill in a username (a name representing this new private key), email address (Apple ID) and your country.
../../../../../_images/334.png

Note

If you import an existing private key, you will also need to upload the certificate associated with this private key to Monaca. Please refer to Step 2 :Import Private Key and Certificate into Monaca.

  1. After creating a new private key, CRS file associated with the private key is also created. Download the CRS file by clicking on Export button. It will be used to issue the certificates later in iOS Dev Center.
  2. Issue certificates in iOS Dev Center and download them.
  3. Create provisioning profiles in iOS Dev Center and download them.
  4. Upload the certificates and corresponding provisioning profiles to Monaca Cloud.
../../../../../_images/1213.png

Note

You can upload multiple certificates with multiple corresponding provisioning profiles with Monaca build interface.

Step 2: Configure iOS App in iOS Dev Center

  1. From Apple Developer page, go to Account.
  2. Sign in using Apple ID and password you used to enroll in the Apple Developer Program. If you haven’t enrolled in this program yet, please subscribe at here.
  3. Go to Certificates, Identifiers & Profiles. Then, the following page will appear.
../../../../../_images/432.png
  1. In this page, we are going to do 4 important things:

Generate Certificates

There are two types of certificates which can be issued in iOS Dev Center:

  • Development: required for Debug build
  • Production: required for either Ad Hoc or Release build

After downloading the CSR file (refer to Configure iOS Build Settings), you are now able to issue and download the certificates in iOS Dev Center.

In the following example, we will show you how to issue and download a Development certificate:

  1. Under Certificates section, go to Development.
  2. Click the Add button + in the upper-right corner (see the screenshot below).
../../../../../_images/525.png
  1. Choose iOS App Development and click Continue.

Note

Choose App Store and Ad Hoc if you want to issue Production certificate.

  1. Click Continue again and upload the CSR file that you’ve downloaded from Monaca Cloud IDE earlier. Then, click Generate.
  2. By now, your development certificate has been issued. Please download this certificate. You will need to upload it to Monaca Cloud IDE later.

Note

Follow similar instruction in order to create a Production certificate.

Register App ID

App IDs are primarily used when creating development and distribution provisioning profiles. You can create a wildcard App ID that matches one or more apps or an explicit App ID that exactly matches your bundle ID.

In order to register your App ID, please follow the instruction below:

  1. Under Identifiers section, go to App IDs.
  2. Click the Add button + in the upper-right corner (see the screenshot below).
../../../../../_images/812.png
  1. The App ID string contains two parts (Prefix and Suffix) separated by a period (.). Fill in the information of your App ID such as:
  • App ID Description: Description of your App ID. You cannot use special characters such as @, &, *, ', ".

  • App ID Prefix: It is defined as your Team ID by default.

  • App ID Suffix: It is defined as a Bundle ID search string. There are two types of App ID Suffixes:

    Explicit App ID Register an explicit App ID if you plan to incorporate app services such as a Game Center, In-App Purchase, Data Protection, and iCloud, or just want a provisioning profile unique to a single app. Enter a unique string in the Bundle ID field of Explicit App ID which should match with the Bundle ID of your app. The App ID must match the one you set in Monaca Cloud IDE as shown in Configure iOS App Settings.
    Wildcard App ID Register a wildcard App ID if you want to use a single App ID for building and installing multiple applications. Enter an asterisk (*) as the last digit in the Bundle ID field of wildcard App ID.
  • App Services: Select the services you want to enable in your app.

  1. Then, click Continue. After reviewing your App ID’s info, click Submit. By now, you have completed your App ID registration into iOS Dev Center.

Register Development Devices

You are required to register your development device(s) before creating development and distribution provisioning profiles.

In order to register a device that you will be using during your app development, please follow the instruction below:

  1. Under Devices section, select a type of device(s) you want to register.
  2. Click the Add button (+) in the upper-right corner (see the screenshot below).
../../../../../_images/911.png
  1. Fill in the information of your device.
  • Name: a name represent your device (Example: MyiPhone)

  • UDID: a unique device identifier of your device. You can find this identifier by connecting your iOS device to your computer. Then, open iTunes and see the summary of your device. After that, click on the device’s Serial Number to reveal the UDID which consists of 40 characters. Right-click on it to copy this UDID. (See below)

    ../../../../../_images/624.png
  1. Then, press Continue. After reviewing your device’s info, click Register. By now, you have completed your device registration into iOS Dev Center.

Create Provisioning Profiles

One last step before building your iOS app is creating a provisioning profile. There are two types of provisioning profile:

  • Development: used with Development certificate for Debug build
  • Distribution: used with Production certificate for Ad Hoc and Release build

In the following example, we will show you how to create a Development provisioning profile:

  1. Under Provisioning Profiles section, go to Development.
  2. Click the Add button + in the upper-right corner.
  3. Choose iOS App Development and click Continue.

Note

  • Choose Ad Hoc if you want to create Distribution provisioning profile for Ad Hoc build.
  • Choose App Store if you want to create Distribution provisioning profile for Release build.
  1. Select your App ID and click Continue.
  2. Select the certificate(s) you want to include in this profile and click Continue.
  3. Select the device you have previously registered for development and click Continue.
  4. Input a name for the provisioning profile and click Generate.
  5. Now your Development provisioning profile is ready. Please download it. You will need this file when building your iOS app in Monaca later.

Note

Follow similar instruction in order to create a Distribution provisioning profile.

Step 3: Start Building

  1. From the Monaca Cloud IDE menu, go to Build ‣ Build App for iOS.
  2. Select appropriate type of build you want and click Start Build.
../../../../../_images/716.png
  1. It may take several minutes for the build to complete. Please wait. Once the build is completed, your built app is ready to be installed/downloaded. See below screenshot as an example:
../../../../../_images/1115.png