Repository navigation
Simulator: launch and terminate natively (simctl), not through XCTest - #138
Merged
Merged
Conversation
Root cause of the 2026-10-10 hangs, from the driver's own log: the app was not installed on the device, and XCUIApplication.launch() does not fail fast — it records the failure, then waits for accessibility (120 s), takes a spindump and waits for idle: 4 minutes inside one request. The driver serves requests one at a time, so its health checks hung too and the host replaced it, then resent the launch. Lifecycle now runs on the host through CoreSimulator: an installed check (simctl get_app_container, ~0.3 s), terminate, launch (instant, returns the pid or the reason). The driver only attaches to the running app for UI work — the live suite (Settings: launch, find, tap, navigate) passes that way. A transport failure is resent after a driver relaunch only when the request never reached the driver or is safe to repeat (a timed-out tap must not tap twice). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause (from the hung driver session's own log, 2026-10-10): the app wasn't installed on the device, and
XCUIApplication.launch()doesn't fail fast — it records the failure, then waits for accessibility (120 s), takes a spindump, then waits for idle: ~4 minutes inside one request. The driver serves requests serially, so its health checks hung, the host replaced the driver (3× in 10 min) and resent the launch.Fix:
SimLifecycle(host, CoreSimulator viasimctl): installed check (get_app_container, ~0.3 s), terminate, launch (instant; pid or reason).SimClient.launch/terminateuse it;not_installed/launch_failederrors name the next step. The driver only attaches to the running app for UI work.Verified: unit tests (lifecycle: not installed fails at once with no HTTP; terminate-first order; simctl failure message; resend policy). Live:
SAK_LIVE_TESTS=1 SAK_SIM_TESTS=1SimLiveTests 4/4 pass on iOS 26.1 with native launch (driver reads/finds/taps/navigates an app it didn't launch). Manual: installed probe 0.2–0.3 s; launch of Quakely instant. Fullswift testgreen.🤖 Generated with Claude Code