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.

Obtain a development certificate of an Apple Developer account

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

Watch a slideshow for step-by-step instructions:

How to generate a development certificate using a Mac

Back to top

Obtain a development provisioning profile

To install an iOS app on a device, the app must be provisioned to launch on the device.

Note: Each device under test must be included in the provision profile (UDID must be included in list of devices.)

To obtain a provisioning profile:

  1. Open a browser and log in to the Apple Member Center.
  2. Select Certificates > Identifiers & Profiles.
  3. Click All under the Provision Profiles node and select your provision profile, belonging to the same Apple Developer account used to generate the development certificate above. Click Download.

Watch a slideshow for step-by-step instructions:

How to generate an Apple Development provisioning profile

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.

The MC Enabler utility is provided for both Mac and Linux.

  • The MC Enabler for Mac enables you to re-sign and package (instrument) apps.
  • The MC Enabler for Linux only lets you re-sign apps, not package them. For example, you can use it to re-sign the Agent and Launcher apps. A system running with macOS is not required.

Note: The MC Enabler for Linux is no longer supported.

Select a version of MC Enabler for instructions on how to re-sign these apps:

MC Enabler for MacClosed

MC Enabler for LinuxClosed

Re-sign apps on Linux

Note: The MC Enabler for Linux is no longer supported.

To re-sign the Agent apps on a Linux or Window machine, you need a p12 certificate file and a provisioning profile. For details, see Create a development certificate in Linux or Windows. You can create these files on either a Linux or Windows machine, but you can only run the MC Enabler on a Linux machine—not a Windows machine.

To re-sign the Agent apps

  1. Download the MCEnabler for Linux by selecting your version of Mobile Center on ADM Marketplace and copy the file to your Linux machine.
  2. On you Linux machine, extract the files:

    unzip MCEnablerLinux.zip –d <target directory>

  3. Copy the p12 file and provisioning profile you generated earlier, to the MCEnabler directory. Include only the appropriate Linux distribution, redhat or centos.

    cp <p12_file_path> <path to target directory>/MCEnabler/redhat|centos/

    cp <provision_profile_file_path> <path to target directory>/MCEnabler/redhat|centos/

  1. Navigate to the target directory (root folder of MCEnabler) and run the following command:

    chmod -R +x .*

  2. Navigate to the MCEnabler folder on your Linux machine using the appropriate Linux distribution, redhat or centos.

    cd <path to target directory>/MCEnabler/redhat|centos/

  1. Run HPMCEnabler in verbose mode to generate debug logs. The example below is for a Linux server machine. On a Linux connector machine replace "server" with "connector" in the commands:

    ./HPMCEnabler <path to Server installation folder>/server/Agent/HP4M-Agent.ipa --p12-file ./<your_p12_filename>.p12 -p ./<your_provision_profile>.mobileprovision -v

    ./HPMCEnabler <path to Server installation folder>/server/Agent/HPMC-AgentLauncher.ipa --p12-file ./<your_p12_filename>.p12 -p ./<your_provision_profile>.mobileprovision -v

    ./HPMCEnabler <path to Server installation folder>/server/Agent/WebDriverAgentRunner-Runner.ipa --p12-file ./<your_p12_filename>.p12 -p ./<your_provision_profile>.mobileprovision -v

    ./HPMCEnabler <path to Server installation folder>/server/Agent/WebDriverAgentRunner-Runner_xcode9.ipa --p12-file ./<your_p12_filename>.p12 -p ./<your_provision_profile>.mobileprovision -v

The re-signed files are copied to the Agent folder.


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 hpmc HP4M-Agent.ipa

    sudo chown hpmc HPMC-AgentLauncher.ipa

    sudo chown hpmc WebDriverAgentRunner-Runner.ipa

    sudo chown hpmc WebDriverAgentRunner-Runner_xcode9.ipa

    sudo chmod 755*

  3. Restart the connector service.

See also: