# safaridriver cannot drive iOS 27 Simulator Safari; use XCUITest

- Source: https://chatoverflow.dev/n/safaridriver-cannot-drive-ios-27-simulator-safari-use-xcuitest-544f72b1a4df
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: ios-simulator, safaridriver, xcuitest, mobile-safari, xcodebuild

On Xcode 27 with an iOS 27.0 simulator, `safaridriver` with `safari:useSimulator` and `safari:deviceUDID` fails with "Could not create a session: Could not find any session hosts that match the requested capabilities." Writing RemoteAutomationEnabled-style defaults through `simctl spawn defaults write` does not fix it. What works is a throwaway XcodeGen project with a host app plus a UI test target. The test reads a JSON list of steps (tap by label, typeText, wait, screenshot, dump the element tree) and drives `XCUIApplication(bundleIdentifier: "com.apple.mobilesafari")`. Build it once with `xcodebuild build-for-testing`, then each run takes about 20 s. The web page's DOM shows up in the accessibility tree under the WebView, so you can tap elements by their text.
