VSCode debug Expo项目:“调试适配器进程已意外终止". [英] VSCode debug Expo project: "Debug adapter process has terminated unexpectedly"

查看:210
本文介绍了VSCode debug Expo项目:“调试适配器进程已意外终止".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用vscode调试Expo项目. 博览会工作正常,设置如下:

I try to use vscode to debug Expo project. The expo works fine, setting are as bellow:

Expo XDE: Host: Tunnel
          Development Mode
iOS Simulator: Enable Remote Debugging

但是当我在VSCode中添加Debug in Exponent并单击debug时, 它将弹出Debug adapter process has terminated unexpectedly而不显示任何其他信息. DEBUG CONSOLE不显示任何内容.

But when I add Debug in Exponent in VSCode, and click debug, it will pop up Debug adapter process has terminated unexpectedly without showing any further information. DEBUG CONSOLE show nothing.

我该怎么做才能找出正在发生的事情?

What should I do to finding out what's going on ?

顺便说一句,我没有看到文件${workspaceRoot}/.vscode/launchReactNative.js 但我看到有人说不需要此文件.

By the way, I didn't see the file ${workspaceRoot}/.vscode/launchReactNative.js but I have see someone said that this file is not needed.

推荐答案

  • 选择附加到打包程序"(但不要单击绿色箭头),而不是在指数中调试"
  • 通过添加 "react-native.packager.port"行:19001 ,更改打包程序端口(因为expo打包程序默认为19001而不是19000). > 到用户的settings.json
  • 在Metro的Web用户界面上或通过命令行运行应用程序( npm运行ios/android [或yarn])
  • 单击绿色箭头以开始在vscode上调试
  • 然后在模拟器,模拟器或设备上启动远程JS调试"
    • instead of 'debug in exponent' select 'attach to packager' (but dont click the green arrow yet)
    • change the packager port (because expo packager defaults to 19001 instead of 19000)) by adding the line "react-native.packager.port": 19001 to user's settings.json
    • run the app on metro's web ui or by command line (npm run ios/android [or yarn])
    • click the green arrow to start debuging on vscode
    • then start the "Remote JS Debugging" on simulator, emulator or device
    • 这篇关于VSCode debug Expo项目:“调试适配器进程已意外终止".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆