我无法将 android 模拟器与 react native 调试器连接起来。
当我运行 react-native run-android
,它会成功启动应用程序而不会显示任何错误。它还带来了节点 Metro Bundler。但它没有在 RN 调试器中打印任何日志。当我在页面上按 Reload app 时,它显示以下弹出错误:
React Native: No apps connected
Sending 'reload' to all React Native apps failed. Make sure your app is running in the simulator or on a phone
Popup error when press on RN debugger "Reload app" button
我试过运行这个
adb reverse tcp:8081 tcp:8081
但它不起作用。当我在模拟器中按 Cmd+m 时,它显示多点触控。所以我也无法打开开发者菜单。unintentional triggered when pressed Cmd+m
System:
OS: macOS Mojave 10.14.6
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 60.96 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.12.0 - /usr/local/bin/node
npm: 6.12.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 27, 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.3/11C29 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: ^0.61.5 => 0.61.5
npmGlobalPackages:
react-native-cli: 2.0.1
我该如何解决这个问题?
最佳答案
模拟器是指真机还是安卓工作室?
如果您尝试从 android studio 连接模拟器,请卸载设备并安装 Pixel 2,它可能会对您有所帮助。
并卸载 React native 调试器并安装最新的
关于android - 无法将 Android 模拟器连接到 React Native 调试器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59437544/