我有一个 expo 项目,我们可以运行和构建它,它可以在 android 和 iOS 中正常工作。我想要的是使用我的 Visual Studio 代码调试所述项目。
我遵循了一些指南并尝试了以下操作:
我得到的结果是带有调试器控件的小窗口出现一秒钟然后消失,没有任何日志或证据表明它做了什么。我检查了 vscode 中的终端选项卡、输出选项卡和调试控制台选项卡
顺便说一句,当我启用“远程调试 JS”时,chrome 调试器会启动并完美运行。
我的 launch.json 是由 react native 工具扩展自动生成的。我还尝试将 "sourceMaps":true 添加到附加配置中,最终结果是一样的。这是我的代码:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Android",
"cwd": …Run Code Online (Sandbox Code Playgroud) debugging react-native visual-studio-code expo react-native-tools