> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobster.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Unable to launch WebDriverAgent because of xcodebuild failure

> Appium's XCUITest driver reports this error when xcodebuild fails. Read xcodebuild's output for the cause.

Appium's XCUITest driver ends a session request with it when WebDriverAgent doesn't start. Driver versions before 7.4.0 (March 2024) start the message with `Unable to launch WebDriverAgent because of xcodebuild failure:`. A report from June 2021 shows it on a real device, with nothing after `xcodebuild error message:`:

```text theme={"theme":"css-variables"}
Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
xcodebuild error message:
Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
```

Version 7.4.0 and later word the same failure this way on a real device:

```text theme={"theme":"css-variables"}
Unable to launch WebDriverAgent. Original error: xcodebuild failed with code 65. This usually indicates an issue with the local Xcode setup or WebDriverAgent project configuration or the driver-to-platform version mismatch. Consider setting 'showXcodeLog' capability to true in order to check the Appium server log for build-related error messages.. Make sure you follow the tutorial at https://appium.github.io/appium-xcuitest-driver/latest/preparation/real-device-config/
```

Mobster doesn't use Appium and never prints this line. It builds and starts the same WebDriverAgent with `xcodebuild`. When its build fails, Mobster for Mac shows `The helper app didn't install` and the fix for the error Xcode printed, and **Details** shows Xcode's own lines.

## Why it happens

Appium builds WebDriverAgent with `xcodebuild` and starts it on the device. When `xcodebuild` exits with a code other than 0, Appium reports `xcodebuild failed with code <code>`. It also counts a run as failed when a line of output contains `Error Domain=`, even if the exit code is 0.

The line names no cause. By default Appium logs `xcodebuild`'s output only from the first `Error Domain=` line on, so the error that started it is often missing. Appium's provisioning guide says code 65 means code signing isn't set up correctly. Code 70 can be signing too, or an invalid `xcodebuild` setting such as a wrong platform version.

## Fix

1. Show `xcodebuild`'s output. Add `"appium:showXcodeLog": true` to the capabilities, start Appium with `appium --log appium.log`, and request the session again.

2. Find the first error in that log:

   ```sh theme={"theme":"css-variables"}
   grep -n -E "\[Xcode\].*(error:|Testing failed|Underlying Error)" appium.log | head
   ```

3. To inspect the error in Xcode, run `appium driver run xcuitest open-wda`. It logs the path of `WebDriverAgent.xcodeproj` and opens it in Xcode. Choose the **WebDriverAgentRunner** scheme and your iPhone, set your team under **Signing & Capabilities** for the **WebDriverAgentRunner** target, then **Product › Test**.

4. Match the first error to its fix:

   | The first error | Go to |
   | - | - |
   | `Signing for "WebDriverAgentRunner" requires a development team.` | [Signing requires a development team](https://docs.mobster.dev/troubleshooting/signing-requires-a-development-team.md). In Appium, set `appium:xcodeOrgId` to your team ID and `appium:xcodeSigningId` to `Apple Development` |
   | `Your team has no devices from which to generate a provisioning profile` | [Your team has no devices](https://docs.mobster.dev/errors/your-team-has-no-devices.md). In Appium, set `appium:allowProvisioningDeviceRegistration` |
   | `Failed Registering Bundle Identifier` | [Failed Registering Bundle Identifier](https://docs.mobster.dev/troubleshooting/failed-registering-bundle-identifier.md). In Appium, set `appium:updatedWDABundleId` to an ID of your own |
   | `Unable to find a destination matching the provided destination specifier` | [Unable to find a destination](https://docs.mobster.dev/troubleshooting/unable-to-find-a-destination.md) |
   | `Early unexpected exit, operation never finished bootstrapping` | [Early unexpected exit](https://docs.mobster.dev/errors/early-unexpected-exit.md) |
   | `has not been explicitly trusted by the user` | [Untrusted Developer](https://docs.mobster.dev/troubleshooting/untrusted-developer.md) |
   | `Timed out while enabling automation mode` | [Timed out while enabling automation mode](https://docs.mobster.dev/troubleshooting/timed-out-while-enabling-automation-mode.md) |
   | A signing step fails on a CI machine | Appium's troubleshooting guide names the keychain as one cause: `xcodebuild` can't read the signing key from it. The guide suggests a separate keychain for the key, passed with `appium:keychainPath` and `appium:keychainPassword` |

5. If nothing matches, delete WebDriverAgentRunner from the iPhone, restart the phone and request the session again.

## Check it worked

The Appium log shows WebDriverAgent's session starting, and `curl http://127.0.0.1:8100/status` answers with `"ready"` set to `true`. 8100 is the default of `appium:wdaLocalPort`.

Checked 5 Nov 2026 against Mobster 0.4.0. The Appium messages are from appium-xcuitest-driver 13.0.7. Back to [Troubleshooting](https://docs.mobster.dev/troubleshooting.md#iphone).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.