Skip to content

[build-tools] Reject iOS Simulator UDIDs in device run sessions - #5002

Open
krystofwoldrich wants to merge 2 commits into
mainfrom
krystof/build-tools-reject-ios-simulator-udid
Open

krystofwoldrich wants to merge 2 commits into
mainfrom
krystof/build-tools-reject-ios-simulator-udid

Conversation

@krystofwoldrich

@krystofwoldrich krystofwoldrich commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Why

A UDID read from one session only works until we update the session image, since every image update gives the Simulators new UDIDs. Sessions shouldn't break on the next image update, so we only accept names now.

Related PRs

This set of PRs supersedes #4992 and https://github.com/expo/universe/pull/33935.

How

The agent-device, Appium, Argent and web preview session steps check device_identifier on macOS before they watch startup, claim the warm Simulator or boot anything. A UDID fails with a UserError that asks for a name like "iPhone 17 Pro". UDIDs we pick ourselves (warm Simulator, default iPhone) still pass, and the UDID regex now lives in one module.

Test plan

The new tests run each of the four session steps with a UDID and check that it fails before the startup watch, the warm claim and the boot. They also check that a UDID shaped value on Android passes through. After this ships to the workers, an iOS session with iPhone 17 Pro or with no device should start the same as before.

The session images get new Simulator UDIDs each time they are updated,
so a session can only select its iOS Simulator by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.92%. Comparing base (9148fbd) to head (b67bf29).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5002      +/-   ##
==========================================
+ Coverage   77.92%   77.92%   +0.01%     
==========================================
  Files        1146     1147       +1     
  Lines       58699    58710      +11     
  Branches    13045    13049       +4     
==========================================
+ Hits        45735    45746      +11     
  Misses      12844    12844              
  Partials      120      120              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@krystofwoldrich
krystofwoldrich marked this pull request as ready for review November 30, 2026 21:35
@krystofwoldrich
krystofwoldrich requested review from gabrieldonadel, gwdp and szdziedzic and removed request for gabrieldonadel November 30, 2026 21:35
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

✅ Thank you for adding a changeset!

@szdziedzic szdziedzic 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.

LGTM! Forbidding iOS Simulator UDIDs upfront in all four remote session steps before startup watch, warm claim, or boot is much cleaner than accepting ephemeral image-specific UDIDs, and consolidating IOS_SIMULATOR_UDID_PATTERN into iosSimulatorUdid.ts removes the duplicate regex cleanly.

(Minor non-blocking note: standalone eas/start_ios_simulator workflows still go through IosSimulatorUtils.resolveUdidAsync, which passes UDIDs straight through without checking simctl list, but that's separate from remote sessions and can be left as-is or hardened independently if needed.)

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.

2 participants