fix: fall back to opening Device Hub when the devices:// URL scheme is unavailable - #156
Open
Alarak-Alex wants to merge 2 commits into
Open
Alarak-Alex wants to merge 2 commits into
Alarak-Alex wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'sdevices://URL scheme yet — e.g. fresh Xcode installs where Device Hub was never opened. That failure surfaced to users as theShellOut encountered an errordialog. This PR catches the deep-link failure and falls back toopen -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)
Contents/Developer/Applications/Simulator.app— the wholeApplicationsdirectory underContents/Developeris gone, and noSimulator.appexists anywhere in the Xcode bundle or the simulator runtime cryptex. InsteadContents/Applications/DeviceHub.appships with bundle IDcom.apple.dt.Devicesand thedevicesURL scheme registered in itsInfo.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 newtestLaunchSimulatorAppFallsBackToOpeningDeviceHubWhenDeepLinkFails.Notes
Simulator.app/Contents/MacOS/Simulatorbinary directly.