Set up automatic app packaging and signing services
After you upload an app to UFT Mobile, 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 UFT Mobile, the administrator needs to set up the packaging and signing services.
Whenever an app is repackaged with UFT Mobile 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 UFT Mobile to automatically re-sign apps. This is done by configuring the packager properties file.
You can also package and sign apps manually and then upload them to UFT Mobile. For details see, Package an Android app manually or Package an iOS app manually with the packager service.
Note: App signing services cannot be configured in the Administrator Settings page.
This section is relevant only for on-premises deployments of UFT Mobile.
Before you start
The following are required for the automatic packaging and signing services:
- Development certificate and development provisioning profile that includes a wildcard App ID. For more details on how to generate Apple assets, see iOS assets for signing apps, or see Apple Developer.
For details on when iOS apps need to be signed, see iOS app signing.
- A dedicated Mac machine, with a connection to the UFT Mobile server. The following software should be installed on the Mac machine:
- OSX 10.8/10.9, or macOS Sierra 10.12, High Sierra 10.13, Mojave 10.14, or Catalina 10.15.
- Xcode 6 or higher. Note: Full installation of xCode (install from App Store) is needed for the iOS packager.
You can also use the packaging service to manually sign the Agents, or to sign and package an app. For details, see Package an iOS app manually with the packager service.
Install the packager service
To install the packager:
- Download the iOS packager to a Mac machine. You can download the Packager Service by selecting your version of UFT Mobile on ADM Marketplace
- Double click the iOSPackager.pkg file to start the installer (Admin permissions are required).
- Configure the Packager Service as follows:
- If the connection to the packaging service should be over SSL only, select Enable SSL.
- Provide the IP address of the Mac machine or the fully qualified domain name (FQDN).
- Give the service a meaningful name.
- Select the iOS developer certificate to be used for signing apps. The certificate must be installed on the Mac machine that you are using, and can be seen in the Keychain Access program.
- Select the provisioning profile. Note that the development provisioning profile must belong to the same Apple Developer account selected above.
- Specify a port for the packager service.
- You will be notified when the software is successfully installed. The packager service starts automatically and the UI opens in your browser.
- Prevent your Mac from sleeping. For details, see the Apple documentation.
- Define the packager settings in Adminstration > SETTINGS. For details, see Define packaging settings in UFT Mobile
Tip: You can also use the packaging service to manually sign the Agents, or to manually sign and package an app. For details, see Package an iOS app manually with the packager service.
To view version information, details of packaging services, or to download logs, click the about icon in top right of the packager UI. The packager UI can be accessed at:
http/s://<packager server IP address>:port/instrumentation/
If you selected the Enable SSL option when installing the packaging service:
- Navigate to /opt/uftm/packager/Security/keystore and copy the .p12 file to the UFT Mobile server.
- On the UFT Mobile server machine, run the following command to import the certificate:
<Path to your UFT Mobile server installation folder>\server\jre\bin\keytool -importkeystore -srckeystore <name of file>.p12 -srcstoretype pkcs12 -srcstorepass password -srcalias hpmc -destkeystore <Path to your UFT Mobile server installationfolder>\server\Security\keystore\trustStoreHpmc
<Path to your UFT Mobile server installation folder>/server/jre/bin/keytool keytool -importkeystore -srckeystore <name of file>.p12 -srcstoretype pkcs12 -srcstorepass password -srcalias hpmc -destkeystore <Path to your UFT Mobile server installation folder>/server/Security/keystore/trustStoreHpmc
- Make sure to use https as the packager protocol in iOS packager settings. For details, see Define packaging settings in UFT Mobile. For multiple shared space environments, see Global settings .
Add an additional service
When working with many devices and workspaces, you may need to use different signing services for your devices. For example, in iOS environments you can only sign up to 100 devices with a single certificate. In addition, you may need to provide a solution for one group, without having to rely on the certificate from another group.
The administrator can define multiple packaging services, in addition to the primary packaging service, and then assign them to different workspaces. For details, see Multiple packaging services.
To add an additional service to the packager service:
- Navigate to the installation folder
/opt/uftm/packager/and run the add new service script.
- Provide a name for the new service, and the service port. You will also be prompted for the name of the Apple Developer certificate, and the path to the provisioning profile.
The service is added as a new tab to the packager UI.
To remove a service, navigate to the installation folder
/opt/uftm/packager/ and run the remove service script.
To restart or uninstall the packager service:
When you install the packager service, the service starts automatically and continues to run at all times. If, for some reason, the service is not running and the UI is not available at
http/s://<packager server IP address>:port/instrumentation/, you can restart the service by running the restart script in the installation folder
To uninstall the service, navigate to
/opt/uftm/packager/ and run the unistall script.
To automatically sign the Agents
To simplify the Agent app re-signing process, once the packaging service is set up, you can sign and distribute the agents from the UFT Mobile console.
To automatically sign an Agent app from the app card, navigate to APPS tab in the UFT Mobile Lab console. Select an Agent app, and click the icon. Select an upload and click the icon to sign the app.
To sign the Agent apps with a different provisioning profile from that defined in the primary packaging service, for example if new devices were added to the provisioning profile, click and select the file to upload. The Agent apps will automatically be signed with the selected provisioning profile.
To distribute the signed Agent apps to connectors, navigate to DEVICE LAB > CONNECTORS, select the required connectors in the grid, and click Distribute Agents. Note that even if an earlier upload of an Agent app is selected in the app card, the latest upload is always used for distribution to connectors. For more information , see View and manage connectors (Admin only) and Multiple packaging services.
After the updated Agent apps have been distributed to connectors, select the relevant connectors from the grid and click Reconnect Devices.
If you need to automatically sign the Agent apps with more than one Apple account, you can use the API for iOS agents signing.
You can also package and sign the Agent apps manually and then upload them to UFT Mobile. For details see, Package an iOS app manually with the packager service.
This section is relevant only for on-premises deployments of UFT Mobile. In general, automatic packaging of apps after upload to UFT Mobile requires no additional action.
If your app uses services that require a private key, such as Google Maps or the authentication service, you need to sign your app using your own private key. To enable UFT Mobile to automatically sign your app with your own private key during the packaging process, you need to first set up the app packager for signing Android apps.
By default, UFT Mobile 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 UFT Mobile to automatically sign your app with your own certificate:
- Open the packager properties file on the UFT Mobile 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.
Automatic signing and packaging for UFT Mobile SaaS
The automatic signing and packaging service is hosted.
Open a service request for a dedicated signing/packaging service using your Apple certificate and provisioning profile. When this service is set up, the Agent apps, as well as any app uploaded to UFT Mobile, will be signed automatically with your Apple certificate and provisioning profile.
Alternatively, if you choose not to set up automatic packaging, you can manually sign the Agents and your apps using the iOS Enabler. For details, see Package an iOS app manually with the iOS Enabler.
Note for hosted devices:
When using only UFT Mobile hosted devices, automatic signing and packaging services do not need to be set up:
- Agent signing is not required.
- App signing and packaging services are not required unless your apps need to be automatically packaged and signed with your own Developer certificate.
By default, UFT Mobile 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, open a service request for a dedicated signing service to sign your app with your own private key. Alternatively, you can package the app manually and then upload it. For details, see Package an Android app manually. When using manual packaging and signing, set the Autopacking toggle to OFF.
You can set up UFT Mobile so that when a user uploads an app, UFT Mobile automatically packages the app with record and replay libraries.
- In UFT Mobile, click Administration and select the SETTINGS tab. For multiple shared space environments, see Global settings for iOS Packager settings.
- 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.
- The packaging service machine is set to localhost by default.
- You can enable packaged apps to trust Android User Certificates. This is required when recording a script for load testing using the VuGen MITM protocol.
- Use the Add Service button to add other packaging services in addition to the primary one. For these additional services, you also indicate the workspace that will use this service. Use the Remove button to remove packaging services that you added. You cannot remove the primary service.
- If you enable SSL for the connection to the app packager, you can choose to use the self-signed certicate, or to use a certificate issued by a Certificate Authority (CA). If using a self-signed certificate, you can either import it to the UFT Mobile server as explained in SSL connection above, or disable the iOS app packager cerficate validation setting.
There may be times when the packaging process does not succeed When UFT Mobile is unable to create a packaged version of the app, a notification is displayed. Provided that you are not using a test created with UFT Mobile 1.52 or earlier, nor testing a hybrid app with a test created with UFT Mobile 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 the correct settings for the Mac machine on which the packager service is installed.
- Check the packaging service logs. Click the about icon in top right of the packager UI, and download the log files.
- 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 the iOS Enabler to package your app, make sure that you are using the latest verion of the packager service. For details, see Package an iOS app manually with the packager service.
- The maximum file size that you can upload is 1GB.
To package an iOS app successfully, the Team identifier must be specified in your provisioning profile.
When uploading your UFT Mobile 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 the iOS Enabler. For details, see Package an iOS app manually with the packager service.
The version of the app packager is not compatible with this version of the UFT Mobile server.
The app packager was not configured correctly.
This application no longer exists due to an upgrade of the UFT Mobile 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 iOS Enabler.
The application couldn't be packaged due to an incorrect usage of the iOS Enabler. For details, see Package an iOS app manually with the packager service.
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 the iOS Enabler couldn't code sign the app. For details, see Package an iOS app manually with the packager service.
The application couldn't be packaged because the iOS Enabler couldn't code sign Dylib. Check the Dylib file HPMobileCenter.dylib. For details, see Package an iOS app manually with the packager service.
The application couldn't be packaged because the iOS Enabler couldn't inject the Dylib. For details, see Package an iOS app manually with the packager service.
The application couldn't be packaged because the Dylib is not valid. For details, see Package an iOS app manually with the packager service.
|2829||The application couldn't be packaged because the provision profile is missing a team identifier.|
The app was successfully uploaded and UFT Mobile 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, UFT Mobile 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.