Skip to content

fix: parse simulator runtime version from device-specific runtime ids - #263

Merged
hansemannn merged 2 commits into
mainfrom
fix/iphone-duo-sim-runtime-version
Nov 7, 2026
Merged

hansemannn merged 2 commits into
mainfrom
fix/iphone-duo-sim-runtime-version

Conversation

@hansemannn

Copy link
Copy Markdown
Contributor

Xcode 27.2 ships the iPhone Duo simulator in its own runtime, com.apple.CoreSimulator.SimRuntime.iOS-27-2-iPhone19-4. ioslib mapped that id to version 27.2.iPhone19.4, which breaks the semver sort in the Titanium iOS build as soon as the runtime is installed, for every simulator build:

TypeError: Invalid Version: 27.2.iPhone19
    at iOSBuilder.getDeviceInfo (iphone/cli/commands/_build.js:300)

Only the leading numeric segments of the runtime id are used now, so the Duo runtime maps to 27.2 and its simulators are grouped with the regular iOS 27.2 ones. Verified with Titanium SDK 14.0.0: ti build -p ios --device-id <iPhone Duo UDID> selects the Duo simulator as iOS 27.2.

Xcode 27.2 ships the iPhone Duo simulator in a dedicated runtime
(com.apple.CoreSimulator.SimRuntime.iOS-27-2-iPhone19-4). Mapping that
id to a version produced "27.2.iPhone19.4", which is not a valid semver
and crashed the Titanium iOS build while sorting simulator versions
(TypeError: Invalid Version: 27.2.iPhone19). Only the leading numeric
segments are used now, so the runtime maps to 27.2 like the standard one.
@hansemannn
hansemannn requested review from cb1kenobi and m1ga November 6, 2026 20:32
@hansemannn

Copy link
Copy Markdown
Contributor Author

@cb1kenobi @m1ga Quick fix to properly support the newer runtimes!

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

LGTM

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

The fix is correct, only one smaller note to clean up ti info:

The gap is a second parser in the same file that the PR did not touch. At lib/xcode.js:479 the expression /(iOS|watchOS)-(.+)$/ reads the simctl device list keys and pushes m[2].replace(/-/g, '.') into xc.sims. With the Duo runtime installed that list still contains 27.2.iPhone19.4 next to 27.2. I checked the Titanium SDK: the build command collects those values into a set that it never reads, so this does not crash a build. But ti info prints the list under "iOS Simulators", so users will see the odd 27.2.iPhone19.4 entry there. The same numeric-prefix extraction applied to that block would make the output consistent, and the existing dest.indexOf(ver) check already deduplicates the resulting 27.2.

…Xcode simulator list too

The simctl device list parser that fills xc.sims (shown by `ti info`) still
produced 27.2.iPhone19.4 for the iPhone Duo runtime.
@hansemannn
hansemannn requested a review from m1ga November 6, 2026 21:07

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

let's go 👍

@hansemannn
hansemannn merged commit 10f01c3 into main Nov 7, 2026
5 checks passed
@hansemannn
hansemannn deleted the fix/iphone-duo-sim-runtime-version branch November 7, 2026 07:18
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.

3 participants