Set up automatic app packaging and signing services
After you upload an app to Mobile Center, the server automatically attempts to package the app. This provides users with the option of selecting either a packaged app or the original version when running a test. To enable this functionality of automatic app packaging and signing by Mobile Center, the administrator needs to set up the packaging and signing services.
The following are required for the automatic packaging and signing services:
- A dedicated Mac machine that is available at all times, with a connection to the Mobile Center server.
- Enterprise/ development certificate and development provisioning profile that includes a wildcard App ID. For more details on how to generate Apple assets, see Generate a development certificate and Generate a development provisioning profile, or see Apple Developer.
Note that if you are setting up signing services for signing of Agent apps, you require a development certificate of an Apple Developer account, and a development provisioning profile belonging to the same account. For details on iOS certificates, see Certificates required when signing iOS apps.
If you do not meet the requirements above, you should sign and package your app manually using MC Enabler and then upload it to Mobile Center.
Note: Packaging your iOS app manually with MC Enabler also requires a Mac.
You can set up Mobile Center so that when a user uploads an app, Mobile Center automatically packages the app with record and replay libraries.
- In Mobile Center, click Administration and select the SETTINGS tab.
- In the packaging service sections (for Android or iOS), set the IP address and port of the machine that will be used for repackaging the app. Set the protocol type to HTTP or HTTPS, depending on whether the connection is secure. By default, the Android package service machine is set to localhost.
For Android apps that use services requiring a private key, and for iOS apps, you also need to set up app signing services described below.
Whenever an app is repackaged with Mobile Center record and replay libraries, the app needs to be re-signed. By default, Android apps are signed with a debug certificate, and no additional action is required by the administrator. For iOS apps, or for Android apps that use services requiring a private key such as Google Maps or the authentication service, the administrator needs to set up Mobile Center to automatically re-sign apps. This is done by configuring the packager properties file.
Note: App signing services cannot be configured in the Administrator Settings page.
By default, Mobile Center signs your app with a debug certificate. If your app uses services that require a private key, for example Google Maps or the authentication service, you need to sign your app with your own private key during the packaging process.
To configure Mobile Center to automatically sign your app with your own certificate:
- Open the packager properties file on the Mobile Center Server machine:
<Path to your server installation folder>/server/conf/packager.properties
<Path to your server installation folder>\server\conf\packager.properties
- Enter the following information:
ANDROID_KEYSTORE_PATH = The path to your key store, which is a binary file containing your set of private keys.
ANDROID_KEY_PASSWORD = The password for the private key that you will use to sign the app.
ANDROID_STORE_PASSWORD = The password for the key store.
ANDROID_ALIAS_NAME =The name used to identify the private key entry in the key store.
Note: All four values are required. If any of the values is left empty, the app packaging process will fail.
Before you start:
Make sure that you have a connection to a Mac machine with the following installed:
- JRE for Mac (version 7.x or higher). The environment variable JAVA_HOME must also be set.
As part of the packaging process, the app will also be re-signed with your company's enterprise/development certificate and provisioning profile. You will need the name of the certificate, as well as the path to the provisioning profile on the Mac machine.
- Copy the PACKAGER_SERVICE folder to your Mac machine. You can download the Packager Service by selecting your version of Mobile Center on ADM Marketplace .
- Configure the Packager Service parameters:
- Open the packager.properties file. This file is located here:
<path to PACKAGER_SERVICE>/conf/packager.properties
- Update the file with the following information:
IOS_CERTIFICATE= The name of the enterprise/ development certificate your company uses to sign apps for distribution. The certificate must be installed on the Mac machine that you are using, and can be seen in the OSX Keychain Access program. For automatic signing of the Agent apps, note that you require development certificate of an Apple Developer Account, and a development provisioning profile belonging to the same account. Do not enclose the certificate name with double quotes. For example,
IOS_CERTIFICATE=iPhone Developer: John Doe (FV3HIO864)is in the correct format.
IOS_PROVISION_PATH= The path to the mobile provisioning profile that your organization uses to sign apps for distribution. This is a file that you download from the Apple Developer Member website and install on your Mac. For automatic signing of the Agent apps, note that you require a development certificate of an Apple Developer Account, and a development provisioning profile belonging to the same account.
- Open the packager.properties file. This file is located here:
- Start the Packager:
Open Terminal and type the following commands:
cd /<path to PACKAGER SERVICE>/bin/
- Prevent your Mac from sleeping. For details, see Apple support.
There may be times when the packaging process does not succeed and the app can't be loaded. When Mobile Center is unable to create a packaged version of the app, a notification is displayed. Provided that you are not using a test created with Mobile Center 1.52 or earlier, nor testing a hybrid app with a test created with Mobile Center 2.00, packaging is not essential for testing.
Packaging may not succeed for the following reasons:
- Check the settings that you defined for the packaging service in the Administration > Settings page.
- If you are using your own key to sign Android apps, check that the details in the app packager file on the server machine are correct.
- Check that you have provided parameters for the app packager on your Mac machine, and that the parameters are correct.
- Try uploading the original application again.
- Android apps: If you used the Android Enabler tool to package your app, check that you are using the latest version.
- iOS apps: If you used MC Enabler to package your app, check that you are using the latest version.
- The maximum file size that you can upload is 200MB.
To package an iOS app successfully, the Team identifier must be specified in your provisioning profile.
When uploading your Mobile Center apps, if you encounter a packaging error, use this list to determine the cause of the error. For assistance, contact your administrator.
A general packaging error occurred.
The application couldn't be uploaded, because it used an incorrect version of MC Enabler. For details, see Package an iOS app manually on a Mac machine.
The version of the app packager is not compatible with this version of the Mobile Center server.
The app packager was not configured correctly.
This application no longer exists due to an upgrade of the Mobile Center server. You will need to upload the application again.
One of the properties (PROTOCOL/IP/PORT) of the app packager is missing or incorrect. An administrator can modify these values in Administration > SETTINGS, in the Android/iOS Packaging Service sections.
General Error: The application couldn't be packaged by the MC Enabler.
The application couldn't be packaged due to an incorrect usage of MC Enabler. For details, see Package an iOS app manually on a Mac machine.
The application couldn't be packaged because the app was previously packaged manually with a static library using Xcode.
The application couldn't be packaged because MC Enabler couldn't code sign the app. For details, see Package an iOS app manually on a Mac machine.
The application couldn't be packaged because MC Enabler couldn't code sign Dylib. Check the Dylib file HPMobileCenter.dylib. For details, see Package an iOS app manually on a Mac machine.
The application couldn't be packaged because MC Enabler couldn't inject the Dylib. For details, see Package an iOS app manually on a Mac machine.
The application couldn't be packaged because the Dylib is not valid. For details, see Package an iOS app manually on a Mac machine.
The application couldn't be packaged because MC Enabler failed to copy the JS libraries into the app's folder. For details, see Package an iOS app manually on a Mac machine.
|2829||The application couldn't be packaged because the provision profile is missing a team identifier.|
The app was successfully uploaded and Mobile Center created a packaged version of the app. However, remote content debugging could not be enabled.
Note: For this error, you will not be able to record, replay, or perform spy actions on unpackaged Android apps. As a workaround, try to manually Enable remote content debugging of Android apps. Alternatively, used the packaged app.
The app was successfully uploaded. However, Mobile Center was unable to create a packaged version of the app, nor could it enable remote content debugging.
Note: For this error, try to manually Enable remote content debugging of Android apps.