Skip to content

Open DeviceHub on Xcode 27, where Simulator.app no longer exists - #1

Open
arthurrmp wants to merge 1 commit into
dipendra-sharma:mainfrom
arthurrmp:fix/devicehub-xcode27
Open

Open DeviceHub on Xcode 27, where Simulator.app no longer exists#1
arthurrmp wants to merge 1 commit into
dipendra-sharma:mainfrom
arthurrmp:fix/devicehub-xcode27

Conversation

@arthurrmp

Copy link
Copy Markdown

The bug

Xcode 27 removes Simulator.app entirely and replaces it with DeviceHub.app. The two live in different places:

  • Simulator.appXcode.app/Contents/Developer/Applications/Simulator.app
  • DeviceHub.appXcode.app/Contents/**Applications**/DeviceHub.app (one level up, not under Developer)

simulatorAppPath() builds the first path from xcode-select -p, so on Xcode 27 it points at a file that does not exist. openSimulatorApp() discards the failure:

_ = try? await runner.run("/usr/bin/open", ["-a", path])

The result is that pressing ▶ boots the simulator and no window ever appears, with no error surfaced. The simulator is running headless and the only way to notice is xcrun simctl list.

The fix

Probe for DeviceHub.app and prefer it when present, falling back to Simulator.app otherwise, so both Xcode generations work from the same build. quitSimulatorAppIfIdle() also quits DeviceHub once the last simulator shuts down, matching the existing "no orphan dock icons" behaviour.

Verification

  • Reproduced on a clean build of main on Xcode 27 beta: ▶ boots the device, no window.
  • With the patch: DeviceHub opens and shows the live device window.
  • finded the whole Xcode 27 bundle plus a system-wide mdfind: no Simulator.app anywhere. The bundle ships Create ML, Instruments, DeviceHub, FileMerge, Icon Composer and Accessibility Inspector.
  • swift test: 70/70 pass. Two existing expectations updated for the added DeviceHub quit.

The Simulator.app branch is unchanged in behaviour but was not exercised, as no older Xcode is installed on the machine used here.

Xcode 27 removes Simulator.app and replaces it with DeviceHub.app, which
lives in Contents/Applications rather than under the Developer directory.
Booting a simulator therefore called `open -a` on a path that does not
exist, and since the failure is discarded the simulator came up with no
visible window at all.

Prefer DeviceHub when it is present and fall back to Simulator.app for
older Xcode, and quit DeviceHub too once the last simulator shuts down so
it does not linger.

Verified against Xcode 27 beta, which ships no Simulator.app anywhere in
the bundle. The Simulator.app branch is unchanged from the previous
behaviour but was not exercised, as no older Xcode is installed here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@arthurrmp
arthurrmp force-pushed the fix/devicehub-xcode27 branch from 5034baf to bb72504 Compare August 31, 2026 04:49
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.

1 participant