Skip to content

[Feature]: Support latest simulator runtime within an OS major version #498

Description

@yqiang

Feature Description

When a beta runtime for the next iOS major version is installed, XcodeBuildMCP cannot select the latest simulator runtime within the current major version.

For example, this machine has an available iPhone 17 Pro on iOS 26.5 and an available iOS 27.0 simulator for a different device type. The desired selection is “iPhone 17 Pro on the latest installed iOS 26 runtime.”

Environment

  • XcodeBuildMCP 2.7.0 (Homebrew)
  • Xcode 26.6 (17F113)
  • macOS 26.6

Reproduction

Configure a named simulator and disable the explicit latest-OS suffix:

sessionDefaults:
  simulatorName: iPhone 17 Pro
  simulatorPlatform: iOS Simulator
  useLatestOS: false

Then run:

xcodebuildmcp simulator build

XcodeBuildMCP correctly constructs:

-destination platform=iOS Simulator,name=iPhone 17 Pro

However, Xcode still resolves the omitted OS as OS:latest and fails:

Unable to find a device matching the provided destination specifier:
{ platform:iOS Simulator, OS:latest, name:iPhone 17 Pro }

The same error lists the valid installed destination:

{ platform:iOS Simulator, OS:26.5, name:iPhone 17 Pro }

So useLatestOS: false does not solve this case: omitting OS=latest still has latest-OS semantics in Xcode.

The current CLI exposes --simulator-id, --simulator-name, and boolean --use-latest-os, but no exact OS version or OS-major constraint.

Proposed behavior

Provide a selector that can express “latest installed runtime within this OS major version,” for example:

sessionDefaults:
  simulatorName: iPhone 17 Pro
  simulatorOSMajorVersion: 26

or an equivalent CLI/MCP argument.

XcodeBuildMCP could enumerate available simulators, choose the highest available runtime whose major version is 26 and whose name matches, then invoke Xcode using the resolved simulator UDID (or exact OS version). This should apply consistently to simulator build, build-and-run, test, and other tools that accept a named simulator.

Related issue

#136 requested exact target-OS support and was closed as solved by the CLI. In XcodeBuildMCP 2.7.0, the CLI still does not expose an OS-version selector, and the observed behavior above remains. This request adds the major-version-aware “latest within iOS 26” use case that becomes important when a next-major beta runtime is installed.

Use Cases

  • Installing an iOS 27 beta should not silently move normal project verification away from the latest stable iOS 26 runtime.
  • Exact runtime versions change as Xcode updates (26.4, 26.5, etc.), so pinning a minor version requires ongoing config churn.
  • Simulator UDIDs change when runtimes or devices are recreated, so committing a UDID is brittle.
  • Agents currently have to fail once, list simulators, extract a matching UDID, and retry every build/test workflow.
  • Projects can consistently verify against their supported OS major while still receiving the latest installed minor runtime.

Example Interactions

User: Build and test on iPhone 17 Pro using the latest installed iOS 26 simulator.

XcodeBuildMCP: Resolves the highest available iOS 26.x runtime for iPhone 17 Pro (for example, iOS 26.5), selects its UDID, and runs the requested workflow.

Current workaround:

xcodebuildmcp simulator-management list --output json
xcodebuildmcp simulator build --simulator-id <resolved-udid>

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions