Mac keyboard shortcuts not working on iOS Simulator - xcode

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)

You might have enabled (checked) the "Send all keyboard shortcuts to device" mode. It's in the Hardware > Keyboard submenu.
Pressing both Left and Right Cmd keys at the same time will exit keyboard capturing mode and re-enable menu shortcuts.

You might have disabled(unchecked) "Connect hardware keyboard" option which is in the hardware/keyboard menu. Make sure its checked.

You may need to press the esc key on newer versions of the simulator.
You can also choose which key stops shortcut capture.

Related

Visual Studio Code can't open a folder on MacOS

so I wanted to switch between projects in VSC on my MacBook Air (macOS Monterey) so, like usual, I went for a top bar, selected File, chose Open Folder. But then the Finder window that was prompted stopped responding for my touchpad clicks. It does respond when I try to crawl through folders with my keyboard but at the end I can't choose the folder to open. Any advice?
I'm also experiencing the same issue on my M1 Mac on OS Monterey 20.6 in other applications as well as VS Code. The only solution I found is the workaround posted here: https://discussions.apple.com/thread/253580300
Simply adjust the Finder window size by hovering the mouse over the corner/edge of the window then click & drag. This then makes the Finder window responsive to mouse clicks.

How do I tap a tab in tvOS simulator?

I created a sample tvOS app in Xcode and selected "tabbed application".
Now I have a First, Second buttons at the top that looks like the equivilant of a tab bar. The simulator remote says "Press Option to touch". Pressing Option and clicking on the remote does nothing.
How do I change tabs?
There are a couple of ways to interact with the tvOS Simulator.
First is the via the simulator's Apple TV Remote. This can be enabled via the simulator's menu item Hardware->Show Apple TV Remote:
While holding the Option key on the Mac's keyboard, move the mouse cursor around the Apple TV Remote (specifically above the "Hold Option to touch" text).
Another way to interact with the tvOS Simulator is via the Mac's keyboard. This can be enabled via the simulator's menu item Hardware->Keyboard->Connect Hardware Keyboard. Once enabled, the arrow keys are able to change focus in the simulator.
Besides using Apple TV Remote, you can also use keyboard → and ← to select different tabs.
For Xcode 12.X and beyond you should go to Window -> Show Apple Tv Remote or use Shift + Command + R.
Image

Show all windows OS X keyboard shortcut for mavericks

Is there a keyboard shortcut for OSX Mavericks to show all windows, even the minimized or hidden ones for an application?
I hate having to use my mouse to click on the Chrome icon to open my other chrome windows.
The keyboard shortcut to show all windows for an application is Ctrl+Down then switch between these windows using arrow keys.
To change the keys used for the shortcut to whatever you want, go to System Preferences-> Keyboard-> Shortcuts-> Mission Control-> Application Windows.
It's under the system preferences for Mission Control: there's a shortcut defined there for "Application windows", currently set to ctrl + down arrow
Works for open and minimised windows for your currently chosen application.
Ctrl + ▲ (up arrow) works on my Mac
You can setup a "hot corner" and select "Application Windows". Also you would see the file history in a banner so that you could also access to your files that are minimised.

ios simulator: how to close an app

When you "run" the simulator from xCode, the app automatically launches, and then you can click the home button to suspend the app. What I want to do is close the app from within the simulator. So, how can this be done?
You can also do it with the keyboard shortcut shown under the simulator menu bar (Hardware-> Home).
The shortcut is ⌘+⇧+H, but you need to hit H twice in a row for it to simulate the double press that shows the apps.
For iOS 7 & above:
shift+command+H twice to simulate the double tap of home button
swipe your app's screenshot upward to close it
You'll see screenshots representing the apps suspended on your device - those screenshots respond to touch events. Swiping is the gesture you'll make to "fling" the screenshot off of the screen. Note that on machines where your mouse is intended to represent your finger, you'll click and swipe as if it is your finger tapping and making the gesture.
On the new iPhone X, the simulator was having issues with the mouse/finger gesture.
You can do a long press with the mouse and a close icon will appear. You can use the swipe up gesture as well to close the app.
I had a difficult time in finding a way in XCode 7.2, but finally I had found one. First press Shift+Command+ H twice. This will open up all the apps that are currently open.
Swipe left/right to the app you actually want to close.
Just Swipe Up using the Touchpad while Holding the App would close the app.
Window / Show Device Bezels
And now you can see the real device, so double tap on HOME button and kill you app
You can use this command to quit an app in iOS Simulator
xcrun simctl terminate booted com.apple.mobilesafari
You will need to know the bundle id of the app you have installed in the simulator.
You can refer to this link
Command + shift +h Press H 2 times
Note :- Press H 2 times
For closing (not quit) the running application in Simulator the keyboard shortcut is "shift+command+h".
Double click on the home button and then click and hold the icon like a normal phone and then click close I believe.
Easy way, just click on "Device" menu then select "App Switcher".
Check setting bar -> device -> App Switcher:
Now you can swipe the app up to close it
You can also kill the app by process id
ps -cx -o pid,command | awk '$2 == "YourAppNameCaseSensitive" { print $1 }' | xargs kill -9
this screenshot may be helpful . Click the simulator then go to Device -> App Switcher

Text editor keyboard shortcut that will refresh iOS Simulator's Safari browser?

In text editors like TextMate, pressing
COMMAND + R
will save the html document, switch to a browser like Chrome, and refresh the page.
So the question is, how does one use this keyboard shortcut to refresh the Safari browser within the iOS Simulator?
Is there another editor or program that's more interactive when developing for Safari on iOS?
Thanks for your help.
There's no shortcut within the simulator but if you set up Safari's enable Safari's developer tools (on your desktop) you can use that to debug the simulator. If you have dev tools open, the CMD + R shortcut will refresh the simulator.
Safari > Developer Tools > iPhone Simulator > name of your app
Then CMD + R will make it a lot easier for you!
there is no way to do this by default, but if you're comfortable with working in the shell (e.g. Terminal.app) you could look into something like this command line tool:
https://github.com/fingertips/ios-sim
not sure if you can launch built in apps like safari, tho.
one thing that may be of use is that in desktop safari, if you enable the Develop menu you can set your user agent to be iphone/ipod touch/ipad. i'm not sure how accurate this is, but it might be faster for iterating. (if you don't see the Develop menu in desktop safari, go to preferences, select Advanced and make sure the "Show Develop menu in menu bar" checkbox is checked)

Resources