【发布时间】:2023-11-08 20:23:01
【问题描述】:
我无法将 android 模拟器与 react native 调试器连接起来。
当我运行react-native run-android 时,它会成功启动应用程序而不会显示任何错误。它还带来了节点 Metro Bundler。但它没有在 RN 调试器中打印任何日志。当我在页面上按 Reload app 时,它显示以下弹出错误:
React Native:未连接任何应用
向所有 React Native 应用程序发送“重新加载”失败。确保您的应用在模拟器或手机上运行
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 react-native android-emulator react-native-android