[英]React Native debug release build with Metro
I am working on a react-native application, when I run my debug build I am able to debug using the metro tool using the following commands.我正在开发一个 react-native 应用程序,当我运行我的调试版本时,我可以使用 Metro 工具使用以下命令进行调试。
npx react-native start
npx react-native run-android
Magically my emulator pops up and if I click "d" in the metro terminal it activated my debugging tools.我的模拟器神奇地弹出,如果我在地铁终端中单击“d”,它会激活我的调试工具。
When I run当我跑
npx react-native run-android --variant=release
When I click "d" in the metro terminal it says当我在地铁站点击“d”时,它说
warn No apps connected. Sending "devMenu" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Opening developer menu...信息正在打开开发者菜单...
Is there something about the release build that does not allow for the use of these debugging tools or is there something I need to do within build.gradle or some other configuation file to enable using the metro debugger.是否有一些关于发布版本的内容不允许使用这些调试工具,或者我需要在 build.gradle 或其他一些配置文件中做些什么来启用 Metro 调试器。
I am new to react-native development so my apologies if my terminology is off.我是 react-native 开发的新手,所以如果我的术语不合适,我深表歉意。
Appreciate you help!感谢您的帮助!
After receiving feedback from various people on and off of SO it seems that the debugger is not meant to be used in the release build.在收到来自 SO 内外各种人的反馈后,似乎调试器并不打算在发布版本中使用。
In my circumstance there was an issue with gradle configuration involving react-native-config which was a known issue related to Progaurd which would only impact release builds.在我的情况下,涉及 react-native-config 的 gradle 配置存在问题,这是与 Progaurd 相关的已知问题,只会影响发布版本。
As recommended in this post I used the javascript alert() method to debug the issue.正如这篇文章中所推荐的,我使用了 javascript alert() 方法来调试问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.