How to compile manually iOS apps?

Dominik
2019-02-12 10:37

In this article we are going to see how to publish an app on iTunes.

To know before publishing

1. Xcode and MacOS

To publish an iOS app you need a Mac computer because you must use Xcode software. Actually you can do that without a Mac computer but you have to emulate your computer to install Mac OS and then install Xcode on Mac OS. Here is an article about that:
https://www.udemy.com/blog/xcode-on-windows/

2. The certificates

An iOS publication under one developer account needs 4 files, one file that will sign the certificates and 3 certificates. The file that will sign the certificates and one of the 3 certificates are used for all apps published under one developer account, and the two other certificates must be created each time you will publish a new app.
The ones that are used for all apps published under one developer account:
These 2 files will be created once (the first time you are going to publish under this developer account). It is the CertSigningRequest (CSR) and the iOS distribution certificate (iOS_Distribution). The CSR is created from your computer (must be a Mac) from the Keychain Access, and the iOS_Distribution is created from the Member Center at developer.apple.com.
These two items must be stored in the main certificates folder for this developer account on your computer (it will be better in term of organization if you are willing to publish other apps under this account). Thus if we consider this example, for the client named “John Doe” who has his own developer account, on your computer there will be these folders with this organization:

  • IOS apps
    • John Doe
      • Certificates–> CSR and iOS_Distribution for John Doe account must be stored here after you have created them
      • John Doe 1st app
        • Certificates
        • Screenshots

You will use this CSR and iOS_Distribution certificate for all the apps that you will publish for John Doe, if there are several apps to publish under this account. You create once and you use them each time you publish an app for John Doe under his account. For your information, the Keychain Access to create the CSR is in your Mac in Applications > Utilities.

The two other certificates are the Apple Push Services certificate and the Mobile Provisionning Profile. You will have to create them for each app, as you can see in the video. You will stored them in the certificates folder which is in the app folder. Thus if we consider the previous example, for the client named “John Doe” who has his own developer account:

  • IOS apps
    • John Doe
      • Certificates
      • John Doe 1st app
        • Certificates –> Apple Push Services certificate and Mobile Provisionning Profile for John Doe 1st app must be stored here after you have created them
        • Screenshots

3. To create the screenshots

You will need some screenshots to fill out the app sheet on iTunes. You will be able to make them with Xcode and especially with the iOS Simulator delivered with Xcode. Open the Xcode project that is in the ios_source folder (see in the video when opening the project with Xcode), then choose the target, iPhone 8 Plus for instance, and click on the Play button (For your info, the ios_sources of an app can be downloaded from its page from your backoffice > Manage > Applications):

Take some screenshots of the app for this target using CMD+S from your keyboard, and do it for each target you want screenshots. Before switching from a target to another don’t forget to click on the “stop” button in Xcode.

4. Step to compile an iOS app

Create the items related to the developer account with which you are going to publish

You have to create a CSR file and an iOS Distribution certificate. And you will be able to use these items for all of the next apps you will have to publish under this developer account –> keep them preciously once created.

5. The CSR File

It must be created from the keychain access tool of your Mac. Open it from Applications > Utilities > Keychain Access:

From the menu select “Keychain access” > “Certificate Assistant” > “Request a Certificate From a Certificate Authority”:

In the window that opens, enter the email of the developer account (or any other email address, it doesn’t have any impact), and enter the name of your developer account, and select “Saved to disk”:

Save this CSR to your disk, in a folder related to the certificates of your developer account.

Close the window.

6. The iOS Distribution certificate

 – Connect at https://developer.apple.com/membercenter/index.action with the developer account

– Click on “Certificates, Identifiers & Profiles”

– Click on “Production” which in the main “Certificates” menu in the menu on the left:

– Then click on [+] from the upper right

– Choose “App Store and Ad Hoc” and click on “continue”:

– Click on “Continue” again

– Sign your iOS Distribution certificate with the CSR file you have created before.

– Download the iOS Distribution certificate that has been created.

– Double click on the iOS Distribution certificate (ios_distribution.cer) to add it to the Keychain Access.

7. Create the items related to the app you are going to publish

7.1 The Apple Push Services certificate

Thanks to this certificate you will be able to add push notifications, in-app purchase, and other services to your app. In our case, only the push notification service is interesting.

– Click on “App IDs” from the “Identifiers” menu on the left:

– Click on [+] from the upper right

– Enter your app name, and the bundle id of the app:

– Go below and select “Push Notifications” in the list of “App Services”:

– Click on “Continue”

– Click on “Register” and click on “Done”

– Then in the list, find the app id you have just created and click on “Edit”

– Go at the bottom and in Push Notifications, in the “Production SSL Certificate” section click on “Create Certificate”

– Click on “Continue”

– Click on “Choose File” and upload the CSR file you have created before for this developer account (the same CSR you have used to create the iOS Distribution certificate for this developer account)

– Download the Apple Push Services certificate (aps.cer) that has just been created. Store this certificate in a folder related to this app on your Mac.

– Click on “Done”

-Double click on the Apple Push Services certificate (aps.cer) to add it to the Keychain Access.

7.2 The Provisionning Profile

– click on “Distribution” from “Provisionning Profiles” on the left menu:

– Click on [+] from the upper right

– Choose “App Store” under “Distribution”:

– Select the app ID of your app, and click on “Continue”

– Select the iOS Distribution certificate associated to the CSR you have used to sign the Apple Push Services Certificate you have created just before (it is very important to use the iOS Distribution which has been created with the CSR used to sign the aps.cer of this app. Don’t forget it, and don’t forget that in case you create a new aps.cer for this app with another CSR you will have to create a new provisionning profile too with the iOS Distribution certificate made with this CSR, and then to publish an update of your app on the App Store)

– Click on “Continue”

– Name the provisionning profile and click on “Continue”

– Download the provisionning profile that has just been created. Store this certificate in the folder related to this app on your Mac, and which contains the Apple Push Services certificate created just before.

8. Compiling the app

– Download your iOS source code

– Unzip the folder and open the .xcworkspace file in Xcode

 

Average rating: 0 (0 Votes)

You cannot comment on this entry