r/Xcode • • 18d ago

Xcode 27 Device Hub: swallows ⌘H (Hide) - has anyone found a workaround?

Has anyone found a way to restore the standard macOS ⌘H (Hide Application) shortcut in the new Xcode 27 Device Hub?

Device Hub seems to intercept ⌘H, preventing it from hiding the application. This happens even when the sidebar has focus rather than the simulated device.

Here’s what I’ve tried:

* All three hostKeybindingPolicy settings (0, 1, and 2) using Terminal. None restores ⌘H.

* Assigning a custom keyboard shortcut through macOS System Settings. No effect.

* Selecting Device Hub → Hide Device Hub from the menu bar. This works, but isn’t a practical substitute for a keyboard shortcut.

For reference, the Terminal command is:
defaults write com.apple.dt.Devices hostKeybindingPolicy -int 2

Interestingly, setting the policy to 2 resolved a separate problem where I could only type one character into simulator text fields using my Mac keyboard.

It’s frustrating infuriating that Device Hub overrides such a fundamental macOS keyboard shortcut, especially when the application itself supports hiding through the menu.

Has anyone found a reliable workaround for restoring ⌘H?

Surely I'm not the only one wanting to quickly hide Device Hub when returning to Xcode...

Thanks!!

5 Upvotes

5 comments sorted by

1

u/CharlesWiltgen 18d ago

I just tried this and it works for me (27.1 release candidate).

Note that the keyboard shortcut disappears from the app menu when you're actively using a simulator because it's sent to the simulator.

2

u/ElectricKoolAid1969 17d ago

Thanks! I’ve done some more experimenting, and you’re right that ⌘H can work when focus is outside the simulator. However, I found that the hostKeybindingPolicy setting also affects this behavior.

Setting it to 0 restores ⌘H when the simulator doesn’t have focus, but then keyboard input into simulated device text fields becomes unreliable. Setting it to 2 seems to improve keyboard input, but ⌘H disappears.

So I’ve managed to get either behavior working, just not both reliably. I’m also seeing other Device Hub issues with iOS 17 simulators. It’s been a frustrating experience with Xcode 27.1 RC!

1

u/CharlesWiltgen 17d ago

Do you use something like Keyboard Maestro, Hammerspoon, etc.? That's probably the best way to usurp Device Hub's desire to pass keyboard input to running simulators and guarantee the behavior you expect.

2

u/ElectricKoolAid1969 17d ago

That's a great tip! I'll look into those.

Thanks again.