Skip to content

feat: support Xcode 27 by upgrading appium-xcuitest-driver to ^12 (ESM) - #166

Merged
saikrishna321 merged 2 commits into
AppiumTestDistribution:mainfrom
olegzalipskiy:fix/xcode-27-xcuitest-12
Oct 23, 2026
Merged

saikrishna321 merged 2 commits into
AppiumTestDistribution:mainfrom
olegzalipskiy:fix/xcode-27-xcuitest-12

Conversation

@olegzalipskiy

Copy link
Copy Markdown

⚠️ BREAKING CHANGE: requires Xcode >= 15 and iOS >= 15, and the package is now ESM-only. Details in "Breaking changes" below; suggest releasing as 3.0.0.

Problem

On Xcode 27 Simulator.app no longer exists (Device Hub replaces it), and creating an iOS session fails:

Got an unexpected error while opening Simulator UI: The file
/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app does not exist.
    at SimulatorXcode15.startUIClient (.../appium-xcuitest-driver/node_modules/appium-ios-simulator/lib/simulator-xcode-14.ts:416:13)

Closes #165. Upstream context: appium/appium#22368.

Root cause

appium-xcuitest-driver ^10 is pinned, so a private nested xcuitest 10 / appium-ios-simulator 8 is installed, which hard-codes Simulator.app regardless of the xcuitest driver installed next to it.

Fix

  • appium-xcuitest-driver ^10.0.0 -> ^12.0.0 (the only runtime dependency change).
  • xcuitest 12 is ESM-only (exports has no require condition; a CJS build fails with ERR_PACKAGE_PATH_NOT_EXPORTED), so the package is migrated to ESM:
    • "type": "module", relative imports get .js extensions, appium/support.js / appium/driver.js (appium has no exports map), __filename from import.meta.url, named ADB import.
    • removed the deep import appium-xcuitest-driver/build/lib/driver (not exported anymore), the options type is now derived with ConstructorParameters<typeof XCUITestDriver>[0].
    • unit tests: sinon cannot stub native ESM exports, so element.specs.ts uses esmock; mocha config renamed to .mocharc.cjs; @appium/tsconfig declared as a devDependency (it was only resolved transitively and is not hoisted in a clean install).
    • finder.ts gets createRequire so it does not reference an undefined require (its webdriverio path resolution was already stale on main, left untouched).
  • Deliberately not changed: appium-uiautomator2-driver and appium-mac2-driver stay on ^5 / ^3 (verified: build, tests and runtime loading work with them), @appium/types stays ^0.x, no skipLibCheck.

Breaking changes

  • Xcode >= 15 required (appium-ios-simulator 10; 8 supported >= 14).
  • WebDriverAgent deployment target iOS 15 (was 13).
  • Package is ESM-only. Appium loads drivers via import(), so installs are unaffected; only direct require() of files in build/ breaks.
  • Node / Appium requirements are unchanged (node ^20.19 || ^22.12 || >=24, appium ^3). Suggest releasing as 3.0.0.

Evidence

Before (2.0.3): the Simulator.app does not exist error above.

After: Xcode 27.0, iPhone Air, iOS 26.5, fresh APPIUM_HOME, driver installed with appium driver install --source=local, using the public sample app (appium-flutter-server 0.0.33 ios.zip, appium:app) and only the basic capabilities (platformName, automationName, deviceName, platformVersion, udid, app):

Constructing iOS simulator for Xcode version 27.0 with udid '<UDID>'
Flutter server is successfully running on port 9000
New AppiumFlutterDriver session created successfully, session <ID> added to master session list
Event 'newSessionStarted' logged
<-- POST /wd/hub/session 200 7213 ms
<-- DELETE /wd/hub/session/<ID> 200 1031 ms

No Simulator.app does not exist in the log. Commands proxied through the new driver also work against the sample app: GET /context -> NATIVE_APP, find by key (username_text_field) and by text, getText -> "Please Login", displayed -> true, element rect, click, screenshot.

npm ls appium-xcuitest-driver appium-ios-simulator shows xcuitest 12.18.1 / ios-simulator 10.8.0 and no nested older copies. npm run build, npm test (24 passing) and prettier-check pass on Node 22.

Testing notes / not covered

  • Tested locally on Xcode 27 only. Xcode 15-26 goes through the unchanged SimulatorXcode15 path in appium-ios-simulator; this is covered by the existing iOS workflow (Xcode 16.4) rather than a local run.
  • Android and macOS sessions were not exercised end to end.
  • npm install --no-package-lock in CI currently fails with ERESOLVE (webdriverio@9.19.2 vs expect-webdriverio@6.1.0), on main as well. This PR adds --force to the root install steps in the workflows (--legacy-peer-deps is not an option: it skips the appium peer dependency, which src/ imports; with --force the build and the 24 unit tests pass).

Related: #162 hit the same ESM requirement; this PR completes that port.

BREAKING CHANGE: requires Xcode >= 15 and iOS >= 15 (via appium-xcuitest-driver 12 and WebDriverAgent); the package is now ESM-only.

`npm install --no-package-lock` currently fails with ERESOLVE
(webdriverio@9.19.2 vs expect-webdriverio@6.1.0 which needs ^9.28),
on main as well.

--legacy-peer-deps is not suitable: it skips the `appium` peer
dependency, which src/ imports, so build and unit tests fail.
With --force the install succeeds, the build passes and so do the
unit tests.
Xcode 27 no longer ships Simulator.app (Device Hub replaces it), so
creating an iOS session fails with "Simulator.app does not exist".
The driver pinned appium-xcuitest-driver ^10, which brings a private
nested appium-ios-simulator 8 that hard-codes Simulator.app.

- bump appium-xcuitest-driver ^10.0.0 -> ^12.0.0
- xcuitest 12 is ESM-only (no "require" export condition), so the
  package is migrated to ESM: "type": "module", .js extensions in
  relative imports, appium/support.js and appium/driver.js,
  import.meta.url for __filename, named ADB import
- drop the deep import of appium-xcuitest-driver/build/lib/driver,
  which is no longer exported; derive the options type instead
- unit tests: use esmock since sinon cannot stub native ES module
  exports; rename the mocha config to .mocharc.cjs
- declare @appium/tsconfig as a devDependency
- finder.ts: use createRequire so it does not reference an undefined
  `require` in ESM

Refs appium/appium#22368

BREAKING CHANGE: requires Xcode >= 15 and iOS >= 15 (via
appium-xcuitest-driver 12 and WebDriverAgent); the package is now
ESM-only.
@olegzalipskiy

Copy link
Copy Markdown
Author

@saikrishna321
Hi! Just a gentle ping on this PR.

Its realy blocked local development on iOS.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The package-wide ESM migration still needs human confirmation of Android and macOS end-to-end compatibility.

No open issues 🎉

What changed in this PR

Updates the iOS driver dependency to support Xcode 27, addressing #165 through an ESM migration.

Changes:

  • Upgrades XCUITest to v12, requiring Xcode 15+ and iOS 15+.
  • Adapts imports, runtime helpers, and unit tests for ESM.
  • Adds forced dependency installation to CI workflows.
File Description
test/​unit/​utils.specs.ts Uses ESM-compatible imports.
test/​unit/​element.specs.ts Mocks ESM dependencies with esmock.
src/​utils.ts Updates imports and derives __filename.
src/​session.ts Adds import extensions.
src/​macOS.ts Updates imports and session invocation.
src/​logger.ts Updates Appium support import.
src/​iProxy.ts Updates Appium support import.
src/​iOS.ts Derives options from the exported constructor.
src/​driver.ts Updates imports and session cleanup argument.
src/​commands/​element.ts Uses ESM-compatible imports.
src/​android.ts Updates driver and ADB type imports.
package.json Enables ESM and updates dependencies and testing.
finder.ts Creates an ESM-compatible require.
.mocharc.js Removes the previous configuration.
.mocharc.cjs Configures ESM-compatible test discovery.
.github/​workflows/​test.yml Forces dependency installation.
.github/​workflows/​publish.yml Forces dependency installation.
.github/​workflows/​appium3._android.yml Forces root dependency installation.
.github/​workflows/​appium3_ios.yml Forces root dependency installation.

Review effort: Balanced

@KateKimi

Copy link
Copy Markdown

@saikrishna321
Hi!
Really need this PR.
It's currently blocking local development on iOS.

@olegzalipskiy

Copy link
Copy Markdown
Author

@saikrishna321 a short update, with no new action needed beyond a review when you have time.

  • I also verified this on an iOS 27.0 simulator (Xcode 27.0, iPhone Air): the session is created (~90 s including simulator boot and WDA build), and find by key/text, getText, page source and screenshot work against the public sample app. No "Simulator.app does not exist" in the log.
  • The red checks look unrelated to this change: the iOS job cannot find Xcode 16.4 on the macos-26 runner, the Android job fails in the SDK setup step, and the Conventional Commits action cannot load its preset. Details and logs are in CI is failing on the iOS (Xcode 16.4 not on runner), Android (SDK setup) and Conventional Commits jobs #167. UnitTest passes.
  • Regarding the Copilot review: Android and macOS sessions were not tested end to end, only builds and unit tests. Real devices were not tested either.
  • Appium issue #22368 notes that Xcode 27 can no longer run tests on iOS 15/16, so the effective minimum on Xcode 27 is higher than the WDA target (iOS 15).

@KateKimi

Copy link
Copy Markdown

@saikrishna321 Hi! Any updates?

@saikrishna321
saikrishna321 merged commit 3bfcba8 into AppiumTestDistribution:main Oct 23, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS session fails on Xcode 27: "Simulator.app does not exist" (outdated appium-xcuitest-driver ^10 pinned)

4 participants