# iOS signing

> Create the provisioning profile Arcus uses to re-sign your iOS builds and WebDriverAgent, so tests run on real iPhones.

To test on a real iPhone, create a provisioning profile under **Settings** > **iOS Settings**. Arcus uses it to re-sign your iOS builds and WebDriverAgent for the iPhones in the profile. Until a profile exists, the page shows **Not ready to re-sign**. You need an Apple Developer account that can create certificates and profiles.

![Settings > iOS Settings before a profile exists, with the Provisioning profiles and WebDriverAgent tabs and Create new profile outlined.](https://s3.amazonaws.com/static-docs.testsigma.com/arcus/projects/settings_ios_settings.webp)

Only real-device builds are re-signed. A simulator build runs on a simulator as uploaded.

## Create a provisioning profile

The **Create new profile** page has 4 numbered sections. Two of them send you to the Apple Developer portal and back, and each has an **Open the Apple Developer portal** link.

1. In the left navigation, go to **Settings** > **iOS Settings**.

2. On the **Provisioning profiles** tab, click **Create new profile**. The **Create new profile** page opens.

3. In **Profile name**, enter the name to show in the list.

4. Under **Certificate signing request**, click **Generate request**. Arcus downloads the request as `.certSigningRequest`, the file type the Apple Developer portal accepts. The private key never leaves Arcus. To download the request again later, click **Download request**.

5. In the Apple Developer portal, create a certificate from the request:

   - Open **Certificates** and click **+**.
   - Choose **Apple Development** or **iOS App Development**, and continue.
   - Upload the request, then download the certificate (`.cer`).

6. Back in Arcus, under **Upload certificate**, click **Upload certificate** and select the `.cer` file.

7. In the Apple Developer portal, create the provisioning profile:

   - Open **Profiles** and click **+**.
   - Choose **iOS App Development**, and continue.
   - Pick an App ID that covers `com.facebook.WebDriverAgentRunner.xctrunner`. A wildcard App ID (`*`) does.
   - Select the certificate you just uploaded, then the iPhones Arcus should test on.
   - Generate the profile and download the `.mobileprovision` file.

8. Back in Arcus, under **Upload provisioning profile**, click **Upload provisioning profile** and select the `.mobileprovision` file.

9. Click **Done**.

![The Create new profile page, with Generate request, Upload certificate, and Upload provisioning profile outlined.](https://s3.amazonaws.com/static-docs.testsigma.com/arcus/projects/settings_ios_create_profile.webp)

The profile appears in the **Provisioning profiles** list, with its **Apple Team ID**, **Status**, **Devices**, **Signed builds**, and **Expiry date**. The status is **Awaiting certificate** or **Awaiting profile** while setup is unfinished, then **Ready** once both files are uploaded. A profile turns **Expired** on the provisioning profile's expiry date, or **Invalid** if Arcus can't use it. Once a profile is ready, the banner above the list changes to **Ready to re-sign**.

To finish setting up a profile later, click the ellipsis icon (⋯) on its row and select **Continue setup**. To delete a profile, select **Delete profile** from the same menu. This also deletes its key, its certificate, and every app and WebDriverAgent Arcus signed with it.

Apple ties a provisioning profile to the iPhones selected when it was generated. To test on another iPhone, generate a new `.mobileprovision` in the Apple Developer portal that includes it, and replace the file on your existing profile: click the ellipsis icon (⋯) on the profile's row, select **Replace profile file**, and upload the new file. The new file must include the certificate already on the profile. You can replace the file on a **Ready** or **Expired** profile; Arcus then re-signs your builds and WebDriverAgent with it.

An iPhone can be in only one profile. If the file names an iPhone that another profile already has, the upload fails with "N phone(s) in this profile are already provisioned by another profile", followed by the first phone and that profile's name.

## WebDriverAgent

WebDriverAgent drives an iPhone during a run. Arcus signs it with every ready profile, so you never upload it yourself. Until a profile is ready, the **WebDriverAgent** tab reads **No WebDriverAgent signed yet**. Signing starts as soon as a profile is ready, and runs again each time you replace its file. For each ready profile, the tab lists the **Profile**, the **Variant**, the **WDA version** signed, the **Status** (**Pending**, **Signing**, **Signed**, or **Failed**), and **Signed on**. To sign a variant again, click the ellipsis icon (⋯) on its row and select **Re-sign**.

Once a profile is ready, connect the iPhone to the machine running the Arcus Agent and scan for it on **My Local Device** > **Devices**. See [Connect a mobile device](https://testsigma.com/docs/arcus/v2/get-started/installation/arcus-agent/#connect-a-mobile-device).
