> ## 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.

# xcodebuild exited with code 65

> In practice, xcodebuild exits with 65 when a build or test action fails. The code names no cause. Start from the first error in xcodebuild's output.

A tool that runs `xcodebuild` reports its exit code. Appium logs `xcodebuild exited with code '65' and signal 'null'` and then `xcodebuild failed with code 65`. A CI job ends with `Process completed with exit code 65`. In a terminal, `echo $?` prints `65` right after `xcodebuild` stops.

Mobster runs `xcodebuild` to build the helper app (WebDriverAgent) for your iPhone. When that build fails, Mobster for Mac shows `The helper app didn't install` and the fix for the error Xcode printed. For an error it doesn't know, it shows Xcode's last `error:` line. **Details** shows what Xcode said. `mobster test --xctest` runs your XCTest targets on a simulator. When `xcodebuild` exits with 65 and leaves a result bundle, Mobster reads each failure from the bundle. With any other code, or no bundle, it reports `The tests didn't run`.

## What 65 means

`man xcodebuild` says it exits with the codes of `sysexits(3)`. 65 is `EX_DATAERR`:

```sh theme={"theme":"css-variables"}
grep -E "define EX_(DATAERR|SOFTWARE)" "$(xcrun --show-sdk-path)/usr/include/sysexits.h"
```

```text Output theme={"theme":"css-variables"}
#define EX_DATAERR	65	/* data format error */
#define EX_SOFTWARE	70	/* internal software error */
```

In practice, `xcodebuild` exits 65 when the action it ran failed. The summary line near the end of the output identifies the action. Xcode 26.4 uses these summary lines:

| Summary line | What failed |
| - | - |
| `** BUILD FAILED **` | The build. The list under `The following build commands failed:` names each step that failed |
| `** TEST BUILD FAILED **` | The build of the test targets |
| `** TEST FAILED **` | The tests ran, and at least one failed. A runner that never started can end this way too |
| `** TEST EXECUTE FAILED **` | The tests couldn't run, such as when the runner never connected (`Testing failed:`) |

For WebDriverAgent on an iPhone, Appium's provisioning guide says 65 means code signing isn't set up correctly. Its troubleshooting guide adds a cause on CI machines: `xcodebuild` couldn't read the signing key from the keychain.

## Fix

1. Save the whole output, then find the first errors in it:

   ```sh theme={"theme":"css-variables"}
   xcodebuild <your arguments> 2>&1 | tee xcodebuild.log
   grep -n -E "error:|FAILED \*\*|Testing failed|Underlying Error|build commands failed" xcodebuild.log | head -20
   ```

   Start with the first `error:` line. Later errors often follow from it. Run `set -o pipefail` first if you want `$?` to keep `xcodebuild`'s code through the pipe.

2. For tests, keep a result bundle and read its summary:

   ```sh theme={"theme":"css-variables"}
   xcodebuild test <your arguments> -resultBundlePath Results.xcresult
   xcrun xcresulttool get test-results summary --path Results.xcresult
   ```

3. Match the first error to its fix:

   | The first error | Go to |
   | - | - |
   | `Signing for "<target>" requires a development team.` | [Signing requires a development team](https://docs.mobster.dev/troubleshooting/signing-requires-a-development-team.md) |
   | `No Account for Team` | [No Account for Team](https://docs.mobster.dev/troubleshooting/no-account-for-team.md) |
   | `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) |
   | `No profiles for '<bundle id>' were found` | Pass `-allowProvisioningUpdates`, and `-allowProvisioningDeviceRegistration` for a phone your team hasn't registered |
   | `Failed Registering Bundle Identifier` | [Failed Registering Bundle Identifier](https://docs.mobster.dev/troubleshooting/failed-registering-bundle-identifier.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) |
   | `No space left on device` | [No space left on device](https://docs.mobster.dev/troubleshooting/no-space-left-on-device.md) |

4. On a CI machine where signing fails with no clearer error, look at the keychain that holds the signing key. Appium's troubleshooting guide names it as one cause of 65 and suggests a separate keychain for the key.

5. Fix the first error and run the same command again.

## Check it worked

`xcodebuild` ends with `** BUILD SUCCEEDED **` or `** TEST SUCCEEDED **`, and `echo $?` prints `0`.

Checked 5 Nov 2026 against Mobster 0.4.0. The commands were checked with Xcode 26.4. Back to [Troubleshooting](https://docs.mobster.dev/troubleshooting.md#checks).


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