Repository navigation
feat: support Xcode 27 by upgrading appium-xcuitest-driver to ^12 (ESM) - #166
Merged
saikrishna321 merged 2 commits intoOct 23, 2026
Conversation
`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.
Author
|
@saikrishna321 Its realy blocked local development on iOS. |
There was a problem hiding this comment.
🔵 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
|
@saikrishna321 |
Author
|
@saikrishna321 a short update, with no new action needed beyond a review when you have time.
|
|
@saikrishna321 Hi! Any updates? |
saikrishna321
merged commit Oct 23, 2026
3bfcba8
into
AppiumTestDistribution:main
1 of 4 checks passed
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.
Problem
On Xcode 27
Simulator.appno longer exists (Device Hub replaces it), and creating an iOS session fails:Closes #165. Upstream context: appium/appium#22368.
Root cause
appium-xcuitest-driver ^10is pinned, so a private nested xcuitest 10 /appium-ios-simulator8 is installed, which hard-codesSimulator.appregardless of the xcuitest driver installed next to it.Fix
appium-xcuitest-driver^10.0.0->^12.0.0(the only runtime dependency change).exportshas norequirecondition; a CJS build fails withERR_PACKAGE_PATH_NOT_EXPORTED), so the package is migrated to ESM:"type": "module", relative imports get.jsextensions,appium/support.js/appium/driver.js(appium has noexportsmap),__filenamefromimport.meta.url, namedADBimport.appium-xcuitest-driver/build/lib/driver(not exported anymore), the options type is now derived withConstructorParameters<typeof XCUITestDriver>[0].element.specs.tsusesesmock; mocha config renamed to.mocharc.cjs;@appium/tsconfigdeclared as a devDependency (it was only resolved transitively and is not hoisted in a clean install).finder.tsgetscreateRequireso it does not reference an undefinedrequire(itswebdriveriopath resolution was already stale onmain, left untouched).appium-uiautomator2-driverandappium-mac2-driverstay on^5/^3(verified: build, tests and runtime loading work with them),@appium/typesstays^0.x, noskipLibCheck.Breaking changes
appium-ios-simulator10; 8 supported >= 14).import(), so installs are unaffected; only directrequire()of files inbuild/breaks.node ^20.19 || ^22.12 || >=24,appium ^3). Suggest releasing as 3.0.0.Evidence
Before (
2.0.3): theSimulator.app does not existerror above.After: Xcode 27.0, iPhone Air, iOS 26.5, fresh
APPIUM_HOME, driver installed withappium driver install --source=local, using the public sample app (appium-flutter-server0.0.33ios.zip,appium:app) and only the basic capabilities (platformName,automationName,deviceName,platformVersion,udid,app):No
Simulator.app does not existin the log. Commands proxied through the new driver also work against the sample app:GET /context->NATIVE_APP, find bykey(username_text_field) and bytext,getText->"Please Login",displayed->true, element rect, click, screenshot.npm ls appium-xcuitest-driver appium-ios-simulatorshows xcuitest 12.18.1 / ios-simulator 10.8.0 and no nested older copies.npm run build,npm test(24 passing) andprettier-checkpass on Node 22.Testing notes / not covered
SimulatorXcode15path inappium-ios-simulator; this is covered by the existing iOS workflow (Xcode 16.4) rather than a local run.npm install --no-package-lockin CI currently fails withERESOLVE(webdriverio@9.19.2vsexpect-webdriverio@6.1.0), onmainas well. This PR adds--forceto the root install steps in the workflows (--legacy-peer-depsis not an option: it skips theappiumpeer dependency, whichsrc/imports; with--forcethe 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.