Skip to content

fix: fall back to opening Device Hub when the devices:// URL scheme is unavailable - #156

Open
Alarak-Alex wants to merge 2 commits into
okwasniewski:mainfrom
Alarak-Alex:fix/device-hub-url-scheme-fallback
Open

Alarak-Alex wants to merge 2 commits into
okwasniewski:mainfrom
Alarak-Alex:fix/device-hub-url-scheme-fallback

Conversation

@Alarak-Alex

Copy link
Copy Markdown

Summary

Builds on #155 by @PaitoAnderson (its patch is applied verbatim as the first commit, with co-author attribution) and adds one hardening discovered while verifying Xcode 27.0 support on real hardware.

The gap: when Device Hub is the target app and a device UUID is given, open devices://device/open?id=<uuid> fails if LaunchServices has not indexed Device Hub's devices:// URL scheme yet — e.g. fresh Xcode installs where Device Hub was never opened. That failure surfaced to users as the ShellOut encountered an error dialog. This PR catches the deep-link failure and falls back to open -a <Xcode>/Contents/Applications/DeviceHub.app, so the worst case becomes "Device Hub opens, user picks the device manually" instead of an error dialog.

Verification (Xcode 27.0, iOS 27.0 runtime, macOS 26)

  • Xcode 27 no longer ships Contents/Developer/Applications/Simulator.app — the whole Applications directory under Contents/Developer is gone, and no Simulator.app exists anywhere in the Xcode bundle or the simulator runtime cryptex. Instead Contents/Applications/DeviceHub.app ships with bundle ID com.apple.dt.Devices and the devices URL scheme registered in its Info.plist.
  • open "devices://device/open?id=<udid>" launches Device Hub, boots a shutdown device, and focuses its window — verified end-to-end, which is exactly the mechanism Add Device Hub Support #155 relies on.
  • xcodebuild test -scheme MiniSim -destination 'platform=macOS' fully green, including the new testLaunchSimulatorAppFallsBackToOpeningDeviceHubWhenDeepLinkFails.

Notes

  • If Add Device Hub Support #155 merges first, happy to rebase this down to just the fallback commit (or close it in favor of a follow-up to Add Device Hub Support #155).
  • No issue exists yet for the Xcode 27 breakage (Simulator.app removal), so this PR also serves as the report: MiniSim ≤ 0.10.0 cannot open iOS simulators on Xcode 27 because it execs the removed Simulator.app/Contents/MacOS/Simulator binary directly.

Alarak-Alex and others added 2 commits September 17, 2026 20:17
Applies the patch from okwasniewski#155 by @PaitoAnderson. Xcode 27 removed
Simulator.app (Contents/Developer/Applications no longer exists) and
replaced it with Device Hub in Contents/Applications, which is targeted
through the devices:// URL scheme.

Co-authored-by: Paito Anderson <pj.paito@gmail.com>
LaunchServices may not know Device Hub's devices:// scheme yet on fresh
Xcode installs, which makes `open devices://…` fail and surfaces an
error dialog. Fall back to opening Device Hub itself so the worst case
is picking the device manually instead of an error.
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