VSCode debug Expo project: “Debug adapter process has terminated unexpectedly”

折月煮酒 提交于 2020-01-06 07:38:07

问题


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

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 ?

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.


回答1:


  • 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


来源:https://stackoverflow.com/questions/50772013/vscode-debug-expo-project-debug-adapter-process-has-terminated-unexpectedly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!