Re-sign the Agent apps

The Agent apps are standard iOS applications that need to be installed on each device that you want to use with Mobile Center.

More about the Agent apps

The Agent apps provide a communication channel between the device and Mobile Center.

The following apps must be re-signed with a development certificate of an Apple Developer account, and a development provisioning profile belonging to the same account:

  • Agent
  • Agent Launcher
  • WebDriverAgent Runner-Runner
  • WebDriverAgentRunner-Runner_xcode9

The certificate and provisioning profile provide the identity of the developer, and the list of devices on which distribution of the app is allowed.

Generate a development certificate

The Agent apps (Agent, Launcher, WebDriverAgentRunner-Runner and WebDriverAgentRunner-Runner_xcode9) must be re-signed with a development certificate of an Apple Developer account.

The steps below describe how to generate a development certificate of an Apple Developer account. If you already have a Developer certificate, you can skip this section:

  1. Open the Keychain Access app.

  2. Select Certificate Assistant > Request a Certificate From a Certificate Authority.
  3. Enter your email address (twice), name, and select Save to disk. Click Continue. This creates a *.csr file.
  4. Open a browser and log in to the Apple Member Center.
  5. Select Certificates, Identifiers & Profiles.
  6. In the Certificate section, select All.
  7. Click the + (Add) button.
  8. When you are prompted to indicate the type of certificate, select iOS App Development and click Continue. Click Continue again in the next screen.
  9. Click Choose File and locate the *.csr file created above. Click Generate.
  10. Click Download to save the certificate to your machine.
  11. Double click on the downloaded certificate to install it to the Keychain Access.

Back to top

Prepare to create a provisioning profile

Provisioning profiles allow you to install apps on your iOS devices. A provisioning profile requires an App ID, device identifier (UDID), and a developer certificate.

Each device under test must be included in the provision profile—its UDID must be included in list of devices.

Note: The provisioning profile is a required for submitting your app to the App Store.

This section describes how to create an App ID and obtain a UDID. For details about generating a Developer certificate, see Generate a development certificate.

Create an App ID

The first step in preparing for a provisioning profile is creating an App ID. You should create a wildcard App ID which will allow you to match all bundle IDs.

To create a wildcard App ID:

  1. Open a browser and log in to the Apple Member Center.
  2. Navigate to Certificates, Identifiers & Profiles.
  3. Select Identifiers > App IDs.
  4. Click the + (Add) button in the upper right-hand corner.
  5. In the App ID Description field, enter a description for the App ID.
  6. In the App ID Suffix section, select Wildcard App ID. Enter an asterisk (*) in the Bundle ID field, to match any bundle ID.
  7. Click Continue, then Register, then Done to complete the creation of the App ID.

Create and register a UDID

This section describes how to get a UDID (Unique Device ID) of the device you want to include in the provision profile.

To obtain and register the device's UDID:

  1. Physically connect your iPhone device to your MacBook.
  2. Start iTunes.
  3. Locate your device in the list of devices and click it to get the device ID. Copy it to the clipboard.
  4. Navigate to Devices > iPhone and click + (Add) in the upper right-hand corner.
  5. Choose Register Device. Give the device a name and paste in the device UDID you got from iTunes.
  6. Click Continue.

Back to top

Generate a development provisioning profile

Once you have created an App ID, obtained a UDID, and signed a certificate, you can generate a development provisioning profile.

To generate a provisioning profile:

  1. Open a browser and log in to the Apple Member Center.
  2. Navigate to Provisioning Profiles > Development.
  3. Click the + (Add) button in the upper right-hand corner.
  4. In the Development section, select iOS App Development. This indicates that you are creating a provisioning profile for development purposes. Click Continue.
  5. Choose the wildcard App ID, defined earlier. Click Continue.
  6. Select your development certificate. Click Continue.
  7. Select the devices you want to include in the provisioning profile. Make sure the UDIDs of your test devices are included and selected. Click Continue.
  8. Provide a name for the profile. Click Continue.
  9. Click Download. After the download, click Done.

Back to top

Re-sign and deploy the Agent apps automatically

To simplify and support automation of the Agent app re-signing process, Mobile Center administrators can set up automatic Agent signing and distribution. At the end of the process, the re-signed Agent apps will be distributed to all connectors that are currently connected the Mobile Center server, as well as any connector that connects to the server in the future.

Note: The re-signed Agent apps are not installed on the connected devices until the connector is restarted, or the devices are reconnected.

Automatic signing requires a Mac machine that is available at all times, with a connection to the Mobile Center server. If you do not have a dedicated Mac machine available, see Re-sign and deploy the Agent apps manually.

To set up automatic iOS Agent app signing and distribution:

  1. Make sure that you meet the requirements for automatic signing as described in iOS - Prerequisites
  2. Set up the signing service for iOS.
  3. Define packager settings for iOS.
  4. Select DEVICE LAB> CONNECTORS. In the sign and distribute agents section, click START. For more information , see View and manage connectors.

Back to top

Re-sign and deploy the Agent apps manually

If you do not have a dedicated Mac machine available, use the MC Enabler utility to sign and package the Agent apps manually.

To re-sign the Agent apps:

  1. Download the MC Enabler package for MacOS onto your Mac. You can download the complete package by selecting your version of Mobile Center on ADM Marketplace, or copying it from the Agent directory on the Mobile Center server machine. The Agent directory can be found in the following location on the server:
    Linux: <Path to your server installation folder>/server/Agent (Default: /opt/mc/server/Agent)
    Windows: <path to server installation folder>\server\Agent
    (Default: C:\Program Files\Mobile Center Server\server\Agent)

    We recommend using the GUI version of the app. For details on using the command line version, see MC Enabler on Mac - command line version.
  2. Locate the Agent files in the Agent folder on the Mobile Center server machine:
    HP4M-Agent.ipa
    HPMC-AgentLauncher.ipa
    WebDriverAgentRunner-Runner.ipa
    WebDriverAgentRunner-Runner_xcode9

    You can find the folder in the following location:
    Linux: <path to your server installation folder>/server/Agent. (Default: /opt/mc/server/Agent)
    Windows:<Path to your server installation folder>\server\Agent
    . (Default: C:\Program Files\Mobile Center Server\server\Agent)
  3. Copy the files to your Mac machine.
  4. Copy the provision profile that you created to your Mac machine. For details, see Generate a development provisioning profile.
  5. Select the Agent/L mode in the MC Enabler window to show the relevant fields.

    UI Element Description
    Agent/L -
    The Enabler mode for code signing the Agent ipa files.
    Original IPA
    The full path to the original ipa file. For example /<full_path>/HP4M-Agent.ipa
    Destination
    A destination for the generated files on your Mac machine.
    Provision Profile
    The path to the provisioning profile file on your Mac machine.
    Certificate Name

    A drop-down list of the installed certificates from the Keychain. Select the required certificate from the list. If the certificate is not listed, it is not properly installed on this Mac machine.

    Note: The MC Enabler does not check the validity of the certificate, so you must ensure that it is valid.

    Verbose
    Displays warning and error messages in the text area, if the Agent is not enabled properly.
  6. Fill in all of the fields and click Run. This generates an additional HP4M-Agent enabled ipa file, customized with your code signing certificate and provisioning profile.

Distribute the re-signed apps (manual signing only)

Once you re-sign the Agent apps, deploy them in the following way:

  1. Rename the files by removing -Codesigned from the file name. For example, the Agent file should be renamed from HP4M-Agent-Codesigned.ipa to HP4M-Agent.ipa
  2. Copy the re-signed apps over to the Agent folder on the Mobile Center server (if connecting devices directly to the server) and connector machines:

    Windows

    Server:
    <Path to server installation folder>\server\Agent

    (Default: C:\Program Files\Mobile Center Server\server\Agent)

    Connector:
    <Path to Windows Connector folder>\Agent
    (Default: C:\Program Files\Mobile Center Connector\Agent)

    Linux

    Server:
    <path to server installation folder>/server/Agent
    Default: /opt/mc/server/Agent

    Connector:
    <path to connector installation folder>/connector/Agent
    Default: /opt/mc/connector/Agent

    Mac

    Connector:
    <path to connector installation folder>/connector/Agent
    Default: /opt/mc/connector/Agent

    Run the following commands in the Agent folder:

    sudo chown mc HP4M-Agent.ipa

    sudo chown mc HPMC-AgentLauncher.ipa

    sudo chown mc WebDriverAgentRunner-Runner.ipa

    sudo chown mc WebDriverAgentRunner-Runner_xcode9.ipa

    sudo chmod 755*

  3. Restart the connector service.

See also: