在vscode中用lldb调试swift如何配置tasks.json
时间: 2023-02-09 09:19:28 浏览: 246
在 VSCode 中使用 LLDB 调试 Swift 需要配置 tasks.json 文件。下面是一个示例 tasks.json 配置:
{
"version": "2.0.0",
"tasks": [
{
"label": "Build and Debug",
"type": "shell",
"command": "swift build && lldb .build/debug/${relativeFile}",
"args": [],
"options": {
"cwd": "${workspaceFolder}",
"env": {},
"shell": true
},
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true
},
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
其中,"command" 中的命令行指令用于编译项目并进入 LLDB 调试模式,"cwd" 指定了项目的工作目录。
配置完成后,你可以在 VSCode 中使用 "Task: Run Task" 命令运行 "Build and Debug" 任务,这样就可以在 VSCode 中使用 LLDB 调试 Swift 代码了。
阅读全文
相关推荐

















