问题
All the mac keyboard short cuts like Cmd+Q (Quit Simulator app), Cmd+K (Toggle keyboard hide/show in Simulator) etc has stopped workings for iOS Simulator app since this morning suddenly.
All other apps, including Xcode, shows the shortcut in menus and they are working fine.
I noticed, the shortcut keys shows up against menu items momentarily on launch of simulator but then disappears completely (see attached)...
I tried following but no success...
Launch simulator (Open Xcode project and then menu Product > Run. And, directly through menu Xcode > Open Developer Tools).
Erase All Content and Settings in Simulator...
Restart Mac
Xcode 9.0.1 (9A1004) | Mac 10.13 (17A405)
回答1:
You might have enabled (checked) the "Send all keyboard shortcuts to device" mode. It's in the Hardware > Keyboard submenu.
Pressing Left + Right command keys at the same time will exit keyboard capturing mode and re-enable menu shortcuts.
回答2:
You might have disabled(unchecked) "Connect hardware keyboard" option which is in the hardware/keyboard menu. Make sure its checked.
来源:https://stackoverflow.com/questions/47044924/mac-keyboard-shortcuts-not-working-on-ios-simulator