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. For details,
refer to the section called “Product Activation” in Appeon Server Configuration Guide for .NET or in Appeon Server Configuration Guide
for J2EE.

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.xcodeproc 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 46. 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 47. 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 48. Edit Scheme

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

In the left column, select Archive;

Select the project from Scheme;

Select iOS Device from
Destination;

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

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

Click OK to save the
settings.

Figure 49. 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 Appeon Developer Package tool can be reconfigured
here and you can also configure those that are not listed in the Appeon Developer Package tool (only the required
information are listed for configuration in the Appeon Developer Package tool).

Task 3.4: Create the archive

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 51. 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.

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

Figure 52. Add files to "EonNativeApp"

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 53. Select the destination checkbox

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.