【问题标题】:How we can debug React-Native application?我们如何调试 React-Native 应用程序?
【发布时间】:2019-03-23 08:22:13
【问题描述】:

我正在使用 google chrome 来调试 react native 应用程序,但在源代码选项卡中,我看不到 .js 文件。 为了调试,我使用的是物理设备。

有人知道解决方案吗? 有没有更好的方法来调试 react native 应用?

【问题讨论】:

    标签: reactjs react-native react-redux reactive-programming


    【解决方案1】:

    要调试 react-native 应用程序,有一个 react-native 调试器。它也可以在 iOS 和 Windows 上使用。但是,在 Windows 上,您必须从 github 手动下载它。安装并启动调试器后,您可以从开发者菜单中的应用模拟器连接到它(iOS 上的命令 + d 命令 + m 在安卓模拟器的情况下,在 Windows 上你可以使用 ctrl + m)。

    https://github.com/jhen0409/react-native-debugger

    【讨论】:

      【解决方案2】:

      目前,没有可以向您显示 .js 文件的 react native 调试器,但您可以通过此库调试 UI: [https://github.com/facebook/react-devtools][1]

      您还可以通过编辑 .bashrc 单击错误消息来配置 IDE 以跳转到源代码

      【讨论】:

        【解决方案3】:

        如果您正在使用 Visual Studio Code 并想像所有其他 IDE 一样调试您的 React Native 应用程序,那么您可以从 Microsoft 提供的 React Native Tools 扩展中获得帮助。

        您可以在我的this answer 中详细阅读所有步骤。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2016-09-10
          • 2021-05-26
          • 1970-01-01
          • 2016-08-28
          • 2017-10-20
          • 2020-06-06
          • 2016-01-24
          相关资源
          最近更新 更多