- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我开始使用 React Native 大约 2 周,有时我需要重新安装应用程序,然后再次摇晃手机并启用实时重新加载。
第一周很有趣,但随后在开发时不得不摇晃手机变得很无聊。
是否有任何配置文件可以将这些开发属性设置为始终启用?
最佳答案
有一个与通过用 3 根手指按下屏幕来打开菜单相关的封闭问题。您可以检查在最新版本(或在 expo 中)是否正常工作:https://github.com/facebook/react-native/issues/10191
还有其他3种解决方案:
1) 您可以在终端中运行 adb shell input keyevent KEYCODE_MENU
2)试试这个:https://github.com/facebook/react-native/issues/10191#issuecomment-328854286
Open RN dev menu
/usr/local/bin/adb shell input keyevent KEYCODE_MENU Reload RN
/usr/local/bin/adb shell input keyevent 82 /usr/local/bin/adb shell input keyevent 66 /usr/local/bin/adb shell input keyevent 66 (reload was not always working without adding the last line)
In Preferences->Keyboard->Keyboard shortcuts you can then map these services to keyboard shortcuts. I added the shortcuts for the context of my editor (Webstorm) and React Native debugger. In these programs I can now press Ctrl+D to show the developer menu and Ctrl+R to reload which works perfectly.
Set up an Automator Service by opening Automator, clicking “New Document”, and choosing “Service”.
Find and select the “Run Shell Script” action. Choose “no input” for “Service receives” and enter: /usr/local/bin/adb shell input keyevent 82 If adb is located elsewhere in your system, change the path to adb. You can find out with: $ which adb
Save and remember what name you give the action.
- Open “System Preferences”, go to “Keyboard” and select the “Shortcuts” tab. Select “Services” on the left column and find your service by name.
- Click where it says “none” and enter the keyboard shortcut you want to use. Make it something unique or it will conflict with an existing shortcut.
Notes: Android only Must be plugged in If you’ve never run the following with this device, run it first before trying the shortcut: $ adb reverse tcp:8081 tcp:8081
关于react-native - 如何在不摇晃手机的情况下启用实时重载或热重载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46177482/
我是一名优秀的程序员,十分优秀!