简体   繁体   English

React-native,iOS 模拟器停止响应 CMD + D

[英]React-native, iOS simulator stops responding to CMD + D

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:几个月以来,我面临一个非常奇怪的情况,在最新版本的 react native(0.50+ 到 0.60+)上开发时,iOS 模拟器停止响应键盘命令,即:

  • Simulator starts, I can hit Cmd+R or Cmd+D just fine for a few cycles模拟器启动,我可以按 Cmd+R 或 Cmd+D 几个周期就好了
  • 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如果转到Hardware->Keyboard->Send Keyboard Shortcuts并启用它,命令将再次开始工作
  • However then the Cmd+Shift+H doesn't work anymore so I cannot easily close the app if I have to但是,然后Cmd+Shift+H不再起作用,因此如果必须,我无法轻松关闭该应用程序

This is really driving me crazy, has anybody faced the same situation or knows any workaround?这真的让我发疯了,有没有人遇到过同样的情况或知道任何解决方法? Many thanks!非常感谢!

PS I already tried a few months ago to reset everything (including simulator settings and xcode installation) PS 我几个月前已经尝试过重置所有内容(包括模拟器设置和 xcode 安装)

I'm having the same issue.我有同样的问题。 Seems to be an iOS 13.3+ simulator issue as you can see in this thread:正如您在此线程中看到的,似乎是 iOS 13.3+ 模拟器问题:

iOS Simulator CMD+R CMD+D Shake doesn't work at all after some time iOS 模拟器 CMD+R CMD+D Shake 一段时间后根本不起作用

As an alternative, command + ctrl + z still works to access the development menu.作为替代方案, command + ctrl + z仍然可以访问开发菜单。

For me pressing "D" then "⌘+D" solves the issue.对我来说,按“D”然后按“⌘+D”即可解决问题。

The same goes for "R" then "⌘+R". “R”和“⌘+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.感谢这个 GitHub 答案对我的帮助,因为这是一个非常令人沮丧的问题。

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.我注意到按R R在最新的 react-native 版本上重新加载应用程序,与在 android 模拟器上相同,所以这可能是有意更改。

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 cmd + shift + z触发开发菜单,然后点击重新加载
  • r r sometimes also does the trick r r有时也能解决问题
  • d if the simulator is focused d如果模拟器是专注的

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.我还注意到 Cmd D 在 Splashscreen 期间不起作用。

Xcode产品方案

方案配置:调试并检查 Debug 可执行文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM