17

since a couple of months I'm facing a very strange situation, when developing on the latest versions of react native (0.50+ to 0.60+) the iOS simulator stops responding to keyboard commands, that is:

  • Simulator starts, I can hit Cmd+R or Cmd+D just fine for a few cycles
  • After some hot reload cycles, the commands completely stop working
  • If go to Hardware->Keyboard->Send Keyboard Shortcuts and enabled it, the commands start working again
  • However then the Cmd+Shift+H doesn't work anymore so I cannot easily close the app if I have to

This is really driving me crazy, has anybody faced the same situation or knows any workaround? Many thanks!

P.S. I already tried a few months ago to reset everything (including simulator settings and xcode installation)

Oscar Franco
  • 5,691
  • 5
  • 34
  • 56
  • see this: https://stackoverflow.com/questions/47044924/mac-keyboard-shortcuts-not-working-on-ios-simulator . Let me know if it helped you or not, otherwise I can look into it some more. – Joel Jan 14 '20 at 14:18
  • Well, that answer is saying the same thing that I did, which is enabling sending the shortcuts to device, but then the home shortcut does not work anymore, it is not a solution – Oscar Franco Jan 14 '20 at 14:20
  • Do you have `Connect hardware keyboard` enabled, if so, uncheck it. And are you sure you didn't press Left + Right command keys at the same time? This will exit keyboard capturing mode and re-enable menu shortcuts. – Joel Jan 14 '20 at 14:29
  • yes, I'm sure, like I said, everything is working and then after some hot-reload cycles it completely stops listening to keyboard commands – Oscar Franco Jan 15 '20 at 09:44
  • The same happens to me since some months ago. I've checked and it's not the "Connect Hardware Keyboard". – jphorta Apr 03 '20 at 13:47

4 Answers4

27

I'm having the same issue. Seems to be an iOS 13.3+ simulator issue as you can see in this thread:

iOS Simulator CMD+R CMD+D Shake doesn't work at all after some time

As an alternative, command + ctrl + z still works to access the development menu.

GucaTEC
  • 539
  • 5
  • 5
6

For me pressing "D" then "⌘+D" solves the issue.

The same goes for "R" then "⌘+R".

Not sure if you could actually just press any single key before pressing your desired shortcut.

Kudos to this GitHub answer for helping me out as this was an extremely frustrating issue.

UPDATE: Since Xcode 12.5 the shortcut for recording the simulator screen is now also CMD+R. This swallows the first CMD+R because instead it starts recording the simulator screen. The next CMD+R will reload the screen. Fortunately, this can be fixed.

kuhr
  • 582
  • 8
  • 18
3

I have noticed that pressing R R reloads the app on the latest react-native versions, same as on the android emulator, so maybe this is an intentional change.

For those coming in nowadays In any case, so far the workarounds seem to be:

  • cmd + shift + z to trigger the dev menu and then click on reload
  • r r sometimes also does the trick
  • d if the simulator is focused
Oscar Franco
  • 5,691
  • 5
  • 34
  • 56
0

Did you check that you are in Debug Mode and not in Release?

Product > Scheme > Edit Scheme... >

Build Configuration: Debug + check the box Debug executable.

After changing Scheme, better to deinstall your app.

Also I noticed the Cmd D doesn't work during Splashscreen.

Xcode Product Scheme

Scheme configuration: Debug and check Debug executable

Raphael Pinel
  • 2,352
  • 24
  • 26