Xcode UI Test Runner and Code Signing

iOS Code Signing

An Xcode UI Test is deployed to iOS devices like standard iOS applications. As a result, they are also subject to the same code signing requirements as normal iOS applications.

Your need a iOS code signing identity (certificate) to sign your Xcode UI Test, and a provisioning profile which allows you to deploy applications signed with your iOS code signing certificate to your iOS devices.

You can obtain an iOS code signing identity by:

You must complement an your iOS code signing identity with a provisioning profile, which allows you to run applications signed with your iOS code signing identity on specific devices.

Provisioning profiles include so-called entitlements, which are permissions granted to your application. Your provisioning profile must include the so-called get-task-allow entitlement. This entitlement grants your application special developer or debugging rights, such as acting as an Xcode UI Test and automating your iOS device. iOS applications distributed through the App Store do not have this entitlements.

iOS code signing identities and provisioning profiles can be managed by Xcode and exported through Developer Profiles. Developer Profiles are simple .zip files. You can update developer profiles through Xcode or manually.

xcuitrunner and Code Signing

When you launch WDA using xcuitrunner, you can specify a developer profile (using the --developerProfile and --developerProfilePassword flags.

When you launch a Xcode UI Test using xcuitrunner, xcuitrunner inspects your developer profile and selects a matching code signing identity and provisioning profile.

Updating provisioning profiles

You need to add your iOS device to your provisioning profile. You can add new iOS devices to your provisioning profile using the Apple Devleoper Portal. If you add this updated provisioning profile to your developer profile, xcuitrunner will automatically detect it next time you launch and Xcode UI Test.

  1. Update your provisioning profile using the Apple portal
  2. Download the updated provisioning profile
  3. Add the updated provisioning profile to your developer profile
  4. Launch WDA using xcuitrunner, and specify the updated provisioning profile
  5. WDA will be resigned with the updated provisioning profile and pushed to your device

Compiling Xcode UI Tests

Most customers use xcuitrunner to launch WebDriverAgent.

xcuitrunner ships with an embedded, pre-compiled copy of WebDriverAgent. This means you do not need to compile WebDriverAgent yourself. If required, you can also specify your own copy of WebDriverAgent.

For more information about the Quamotion xcuitrunner command-line utility, contact us at info@quamotion.mobi.

Last modified October 30, 2019: Rename quamotion4appium to xcuitrunner (79abec3)