Skip to content

feat: use xcrun simctl spawn uname to get the simulator architecture - #484

Merged
navin772 merged 3 commits into
mainfrom
use-simulator-arch
Aug 7, 2026
Merged

feat: use xcrun simctl spawn uname to get the simulator architecture#484
navin772 merged 3 commits into
mainfrom
use-simulator-arch

Conversation

@KazuCocoa

Copy link
Copy Markdown
Member

Closes #483

@KazuCocoa
KazuCocoa marked this pull request as ready for review August 6, 2026 13:35
@KazuCocoa
KazuCocoa requested review from Delta456 and navin772 August 6, 2026 13:36

@navin772 navin772 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What do you get when running:
xcrun simctl spawn <udid> uname -m

I get an error and everything next is blocked:

-> xcrun simctl spawn 7CA4AE45-8380-4563-AD17-C8E20506EF4B uname -m
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
The operation couldn’t be completed. No such file or directory
No such file or directory

@KazuCocoa

Copy link
Copy Markdown
Member Author

It might depend on env. I switched to get it via SIMULATOR_ARCHS. Old env might not have this, but so far, maybe such unavailable env is Xcode 12 or around era

Comment thread src/tools/ios/prepare-ios-simulator.ts Outdated
@KazuCocoa
KazuCocoa requested review from navin772 and a lite review from Copilot August 7, 2026 12:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the iOS simulator preparation pipeline to choose the WebDriverAgent (WDA) simulator build based on the simulator’s architecture (instead of the host process architecture), improving compatibility in mixed environments such as Apple Silicon + Rosetta.

Changes:

  • Add a helper to read the simulator architecture via xcrun simctl ....
  • Update WDA resolution to accept the simulator UDID and select the arm64 vs x86_64 WDA artifact accordingly.
  • Add Rosetta detection logging and update the call site to pass the UDID through.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +117 to +121
async function getSimulatorArchitecture(simulatorUdid: string): Promise<string[]> {
const {stdout} = await exec('xcrun', ['simctl', 'getenv', simulatorUdid, 'SIMULATOR_ARCHS']);
const archs = stdout.trim().split(/\s+/);
return archs;
}
Comment on lines +239 to +242
const isRosetta = await exec('sysctl', ['-in', 'sysctl.proc_translated']).then(({stdout}) => stdout.trim() === '1');
if (isRosetta) {
log.info(`Running under Rosetta. Simulator architecture: ${archs.join(', ')}. Using ${archStr} WDA build.`);
}
@navin772
navin772 merged commit 33ffb8a into main Aug 7, 2026
6 checks passed
@navin772
navin772 deleted the use-simulator-arch branch August 7, 2026 16:46
github-actions Bot pushed a commit that referenced this pull request Aug 7, 2026
## [1.92.0](v1.91.0...v1.92.0) (2026-08-07)

### Features

* use xcrun simctl spawn uname to get the simulator architecture ([#484](#484)) ([33ffb8a](33ffb8a))
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.92.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WDA 16.1.5 exits with code 4 on iOS 26 simulators (macOS Tahoe)

3 participants