如何在vscode中配置swift调试的lanch.json
时间: 2023-02-16 18:48:19 浏览: 144
如果你想在 Visual Studio Code (VSCode) 中调试 Swift 代码,首先你需要安装 Swift for Visual Studio Code 插件。
然后,在 VSCode 中打开调试窗口(Ctrl + Shift + D),在调试窗口中单击“创建调试配置”按钮(或点击“设置”图标并选择“添加调试配置”),然后选择 Swift 作为调试类型。
这将在工作区目录中创建一个名为“.vscode/launch.json”的文件,并为你生成一个示例调试配置。你可以根据你的需要修改这个配置文件,以设置调试器的行为。
例如,你可以指定要调试的可执行文件的路径,或者指定要设置的断点和其他调试选项。
具体的,你可以修改“program”字段指定要调试的可执行文件的路径,修改“args”字段指定要传递给可执行文件的命令行参数,修改“cwd”字段指定调试器运行时的工作目录,以及其他调试选项。
示例 launch.json 文件如下:
```
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug My Swift Program",
"type": "swift",
"request": "launch",
"program": "${workspaceFolder}/path/to/my/program",
"args": ["arg1", "arg2"],
"cwd": "${workspaceFolder}",
阅读全文
相关推荐
















