我有一个基本的react-native应用程序,我正在一个真正的Nexus 5上运行,我无法找到一种方法来启用开发人员菜单,这是为iOS和模拟设备提供的。
https://facebook.github.io/react-native/docs/debugging.html
https://facebook.github.io/react-native/docs/running-on-device.html
方法1:使用亚行反向(建议) 如果您的设备运行Android5.0 (Lollipop),启用了USB调试,并且通过USB连接到您的开发机器,则可以使用此方法。 在命令提示符中运行以下命令: $ adb反向tcp:8081 tcp:8081您现在可以使用开发人员菜单中的Reload,而无需任何其他配置。
当我运行react-native run-android时,我在终端中看到了这一行
Running adb -s 06adb216 reverse tcp:8081 tcp:8081
但是我看到没有反应本地应用程序开发人员菜单。
我在跑步:
Windows 10
react-native-cli: 2.0.1
react-native: 0.42.0我的index.android.js文件如下所示:
import { AppRegistry } from 'react-native';
import Welcome from './src/modules/onboarding/components/welcome';
AppRegistry.registerComponent('mobileapp', () => Welcome);发布于 2017-03-29 02:30:00
要在不直接访问硬件或单击事件的情况下使用android设备或模拟器,可以通过adb通过adb shell input keyevent将输入传递到设备上,可以将event_code或string发送到设备。
更多信息在Android调试桥或亚行壳输入上提供。
若要打开菜单控件,请使用adb shell input keyevent 82命令。
如果你需要更多的信息,请告诉我。
你好,杜尔加
https://stackoverflow.com/questions/43071055
复制相似问题