VSCode配置React Native调试环境
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Android",
"type": "reactnative",
"request": "launch",
"platform": "android",
"target": "android",
"sourceMaps": true,
"packageName": "com.yourcompany.yourapp",
"device": "React Native",
"debugServer": [
"localhost:8081"
],
"expoServerPort": 19000,
"expoServerUrl": "http://localhost:19000",
"env": {
"NODE_OPTIONS": "--inspect-brk"
}
}
]
}
这个配置文件是针对VSCode的launch.json文件,用于设置React Native项目的调试环境。其中的关键点包括指定调试目标平台(android),调试服务器地址(localhost:8081),以及如何设置环境变量以启用Node.js的断点调试("NODE\_OPTIONS": "--inspect-brk")。这个配置适用于使用Expo进行React Native开发的情况。
评论已关闭