Task 3: Create the app archive

Task 3.1: Set App ID and Bundle Identifier

In order for the apps running on the same mobile device to be recognized as running on one device not on multiple devices by the Appeon License file, you will need to always input the same App ID for all apps and specify the same bundle identifier for the same app.

You would need to modify the App ID in the keychainaccessgroups.plist file and the Bundle Identifier in the Xcode project settings to match with what you have specified when creating the App ID (in Task 1.4: Create an App ID).

Follow steps below to specify the consistent App ID in the keychainaccessgroups.plist file and the Bundle Identifier in the project settings:

Step 1: Find the keychainaccessgroups.plist file by expanding EonNativeApp > Supporting Files, as shown in the following figure. The keychainaccessgroups.plist file is in the same directory as the EonNativeApp.xcodeproj file.

The key for the app in the keychainaccessgroups.plist file is made up of two parts: App ID + Bundle Identifier, in this format "AppID.BundleIdentifier", take 6DQU2XGFEE.com.appeon.mobile.1.0.2 for example, 6DQU2XGFEE is the App ID, com.appeon.mobile.1.0.2 is the Bundle Identifier.

If you specify a wildcard bundle identifier when creating the App ID, you will need to replace "*" with an explicit string, for example, com.abcexample.app1 or com.abcexample.1 etc.

Figure 43. Keychain access group

Keychain access group

Step 2: Check that the App ID in the keychainaccessgroups.plist file is correct and is the same as the App ID in the provisioning profile.

If the App ID in the keychainaccessgroups.plist file is incorrect, you can input the correct App ID, then click the menu Product -> Clean, and then click Product -> Archive to create the IPA file again.

Step 3: Copy the Bundle Identifier from the keychainaccessgroups.plist file.

Step 4: Click the target project for the app, select the General tab, and then paste to the Bundle Identifier field. By default, the Bundle Identifier on this tab is different from the one in the keychainaccessgroups.plist file.

Also make sure the same Bundle Identifier is input when uploading the app to the App Store.

If you want to make change to the Bundle Identifier, please make sure the same Bundle Identifier is used consistently in all three areas: the keychainaccessgroups.plist file, the General tab, and the App Store upload process.

Task 3.2: Code sign the app

You now code sign the app with the signing certificate contained in the corresponding provisioning profile.

To set the code signing identity to the certificate:

In the Xcode project navigator, select the project, select Building Settings, drag down the screen to find the Code Signing group, make sure Code Signing Entitlements is set to "keychainaccessgroups.plist", then click Release under Code Signing Identity and select the corresponding distribution certificate, and then click Release under Provisioning Profile and select the corresponding provisioning profile.

Figure 44. Code signing

Code signing

Task 3.3: Review the archive scheme settings

You would need to double check the scheme settings to ensure you do not archive a debug version of the app.

To review the archive scheme:

Step 1: From the Xcode dropdown menu, choose Product > Scheme > Edit Scheme to open the scheme editor, as shown in the following figure.

Figure 45. Edit Scheme

Edit Scheme

Step 2: In the scheme editor, do the following:

  1. In the left column, select Archive;

  2. Select the project from Scheme;

  3. Select iOS Device from Destination;

  4. Make sure Release (not Debug) is selected from Build Configuration;

  5. Modify the archive name or use the default name in the Archive Name field.

  6. Click OK to save the settings.

Figure 46. Archive Release

Archive Release

Step 3: (Optional) Click the project for the app, select the General tab, and then configure the Xcode project for distribution. All the information specified in the PowerServer Toolkit Package tool can be reconfigured here and you can also configure those that are not listed in the PowerServer Toolkit Package tool (only the required information are listed for configuration in the PowerServer Toolkit Package tool).

For details about how to configure the settings in Xcode, read Configuring Your Xcode Project for Distribution in the Apple document App Distribution Guide.

Task 3.4: Create the archive

Now you are ready to create an app archive.

Step 1: In the Xcode project editor, select the project.

Step 2: From the Xcode dropdown menu, choose Product > Archive.

Figure 47. Arhive

Arhive

If a prompt appears asking whether code sign can sign the app using a key in your keychain, click Allow or Always Allow.

After the project is built successfully, it will appear in the Archives Organizer, as shown below.

Figure 48. Archive list

Archive list

Now the app archive is ready. You can submit the archive to the Apple App Store or save the file for enterprise or Ad-Hoc distribution.

(Optional) Import the certificate

MobiLink supports the encrypted transmission of the synchronous data stream by using HTTPS. If you want to use HTTPS for the encrypted transmission of the synchronous data stream, you should add the certificate file into the project. The following steps take EonNativeApp as an example.

  1. Right click EonNativeApp and select Add Files to "EonNativeApp..." to choose the certificate file, as shown in the following figure.

    Figure 49. Add files to "EonNativeApp"

    Add files to "EonNativeApp"


  2. In this example, choose the cer.pem.cer file. Make sure to select the Copy items into destination group's folder (if needed) checkbox, as shown in the following figure. Click Add.

    Figure 50. Select the destination checkbox

    Select the destination checkbox


  3. The certificate file is added successfully and is placed in the position parallel to other folders under the EonNativeApp directory, as shown in the following figure.

    Figure 51. The certificate file is added successfully.

    The certificate file is added successfully.


Additional settings for Xcode 9

If you use Xcode 9 to create the app archive, make sure that you also configure the following Xcode 9 settings:

Setting 1: Clear the selection of the Automatically manage signing check box.

Figure 52. Automatically manage signing

Automatically manage signing

Setting 2: Select the corresponding provisioning profile from Signing (Debug) or Signing (Release) section.

Figure 53. Signing (Debug)

Signing (Debug)

Setting 3: Select the corresponding provisioning profile under the Provisioning Profile (Deprecated) section as well.

Figure 54. Provisioning Profile (Deprecated)

Provisioning Profile (Deprecated)

Setting 4: If you are archiving Appeon Workspace, modify the bundle identifier under the Product Bundle Identifier section as well.

Figure 55. Product Bundle Identifier

Product Bundle Identifier