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

# Early unexpected exit, operation never finished bootstrapping - no restart will be attempted

> The UI test runner, such as WebDriverAgent, quit before Xcode could connect to it. Read the Underlying Error in the same line for the cause.

`xcodebuild` prints this under `Testing failed:` when it starts a UI test runner on an iPhone or a simulator. It then exits with code 65. Words in angle brackets are what Xcode fills in:

```text theme={"theme":"css-variables"}
Testing failed:
	<Runner> (<pid>) encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying Error: <the reason>))
** TEST EXECUTE FAILED **
```

`<Runner>` is the test app Xcode installed, such as `WebDriverAgentRunner-Runner` for WebDriverAgent. The last line can also read `** TEST FAILED **`. Xcode 8 printed it as `Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted"`, or with `Code=5`.

Mobster starts the helper app on your iPhone (WebDriverAgent) with `xcodebuild test-without-building`, so this line can appear in the helper's log, `logs/wda-runner.log` in the data folder. Mobster restarts the helper by itself. If it stops with an error three times, Mobster for Mac shows `The helper app didn't start`. When Mobster recognizes the cause in the log, it shows that cause's fix. Otherwise it shows `The helper app keeps stopping. Unlock your iPhone and check Developer Mode.` On a simulator, `mobster verify` ends `couldnt_run` with `WebDriverAgent stopped before it was ready:` and the log's last `error:` line.

## Why it happens

Xcode installs the runner, launches it, and waits for it to connect back to the Mac before the first test. This handshake is called bootstrapping. The runner quit or crashed before it finished, so Xcode stopped and won't try again.

Read the `Underlying Error` in parentheses for the cause:

| Underlying Error | The cause |
| - | - |
| `The test runner exited with code <code> before establishing connection.` | The runner quit before it connected. In a report from 6 Oct 2026 (Xcode 27.0), the iPhone ran iOS 27.2 beta, newer than Xcode's iOS 27.0 SDK. The runner's log showed `Connection peer refused channel request for "dtxproxy:XCTestDriverInterface:XCTestManager_IDEInterface"` |
| `The test runner exited with code <code> while preparing to run tests.` | The same failure, a moment later in the handshake |
| `The test runner crashed before establishing connection: <reason>` | The runner crashed at launch. One cause on record is a framework inside the runner without a valid signature: the log then shows `Library not loaded` and `required code signature missing` |
| `The test runner failed to initialize for UI testing` | Xcode gives no further reason here. If the log also shows `Timed out while enabling automation mode`, see [that page](https://docs.mobster.dev/troubleshooting/timed-out-while-enabling-automation-mode.md) |
| `Unable to launch <bundle id> because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user.` | The phone doesn't trust the developer, or a free account's 7-day signature ran out. See [Untrusted Developer](https://docs.mobster.dev/troubleshooting/untrusted-developer.md) |
| `Unable to launch <bundle id> because the device was not, or could not be, unlocked.` | The phone was locked. See [The device could not be unlocked](https://docs.mobster.dev/troubleshooting/device-was-not-unlocked.md) |
| `Test runner exited before starting test execution.` | Older Xcode versions give no reason. One report on Apple's forums (April 2022) saw it repeat on every run until the iPhone restarted |

The first four rows are quoted from Xcode 26.4's XCTHarness framework. The next two come from iOS, and Xcode passes them on.

## Fix

1. Read the `Underlying Error` and find it in the table above. If it links to a page, follow that page.
2. If the message names a log file (`please attach the log file at …/Session-….log`), open it.
3. Watch the phone's log while the runner starts. Open Console on the Mac, select the iPhone, choose **Start Streaming** and search for `-Runner`.
4. Compare the iPhone's iOS version with your Xcode's iOS SDK version:

   ```sh theme={"theme":"css-variables"}
   xcrun --sdk iphoneos --show-sdk-version
   xcrun devicectl device info details --device <UDID> | grep osVersionNumber
   ```

   With Xcode 26.4, the first command prints `26.4`. The second prints the phone's version, such as `• osVersionNumber: 18.3.2`. A phone newer than the SDK is the mismatch in the 6 Oct 2026 report above.
5. Restart the iPhone. Unlock it and keep it connected.
6. Delete the runner from the phone: touch and hold its icon, then **Remove App › Delete App**. Build it again and start it again.

## Check it worked

The runner's log shows `Test Suite 'All tests' started`, and `xcodebuild` keeps running instead of exiting. For WebDriverAgent, `curl http://127.0.0.1:8100/status` answers with `"ready"` set to `true`, and `mobster doctor` prints a `✓` beside **Phone connection**.

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


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