【问题标题】:Debug a react-native application using nuclide使用 nuclide 调试 react-native 应用程序
【发布时间】:2016-08-28 13:39:25
【问题描述】:

是否有任何关于如何使用 Nuclide 调试 react-native 应用程序的好的文档/视频。

我是新手。这是我第一次开发应用程序,也是第一次使用 React。

我确实使用react-native init 创建了项目。我不认为我找到了一个 BUCK 文件来运行和调试我的应用程序。我也看不到如何查看我的 JS 文件中的错误。我必须运行模拟器才能看到。我使用react-native run-ios 运行它。

我试过Nuclide->React Native->Start Debugging。不知道这应该做什么。

抱歉,如果这些问题听起来很愚蠢。

【问题讨论】:

    标签: react-native nuclide-editor


    【解决方案1】:

    根据this instruction,您应该:

    1. command Palette(Cmd-Shift-P)选择“Nuclide React Native: Start Packager”来启动React Native Server。

    2. 确保你在React Native项目的根目录下,然后从命令行运行应用程序:“$ react-native run-ios”(或者选择其他现有的模拟器,例如react- native run-ios --simulator="iPhone4s")。

    3. 启动服务器后,您可以在应用程序开始运行时启动 React Native 调试器。从command Palette (Cmd-Shift-P),启动“Nuclide React Native:开始调试”。

    4. 在模拟器中按 Cmd-D(在 Linux 上为 Ctrl-D)。这将为您的应用程序调出调试选项。选择“远程调试 JS。

    ...从模拟应用程序启用调试后,Nuclide 将自动附加到该调试过程,因为我们在上面启动了调试器。

    【讨论】:

    • 我找不到 Nuclide React Native:在 commadn Pallet 中开始调试
    • “Nuclide React Native: Start Packager”似乎也不是一回事
    【解决方案2】:

    在 Nuclide 中调试 JS 现在是在 React Native 版本 0.52 2017 年 12 月版本中添加的开发菜单中的一个选项。 See This

    【讨论】:

      猜你喜欢
      • 2017-10-20
      • 1970-01-01
      • 2017-12-26
      • 2016-09-10
      • 2020-11-26
      • 2018-05-22
      • 2016-09-14
      • 2019-03-16
      • 1970-01-01
      相关资源
      最近更新 更多