That’s right - VSCode just calls xcodebuild on the command line and Xcode compiles the binary.
Here is the VSCode task.json and launch.json from one of my plugin projects. To compile I would choose Terminal -> Run Task in VSCode, then choose either the Release or Debug task. To debug I choose Run -> Start Debugging from VSCode’s menu, which runs the “build Debug” task, then launches the DAW I want to debug in (Reaper), and attaches a debugger to it.
I suggest getting your tasks.json working first, then once that’s working make a launch.json.
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "build Debug",
"type": "shell",
"command": "xcodebuild",
// note that we set a SYMROOT that matches xcodes default derived data path,
// otherwise it will put its temporary build files in the project directory.
// I want xcodebuild to use the same path as xcode. This is optional.
"args": [
"-project", "/Users/jonathan/Documents/audio/juce/jon/OSL-Side-Effects/_dev/Builds/MacOSX/OSL-Side-Effects.xcodeproj", "-alltargets", "-configuration", "Debug", "SYMROOT=~/Library/Developer/Xcode/DerivedData", "-quiet"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "build Release",
"type": "shell",
"command": "xcodebuild",
// note that we set a SYMROOT that matches xcodes default derived data path,
// otherwise it will put its temporary build files in the project directory.
// I want xcodebuild to use the same path as xcode. This is optional.
"args": [
"-project", "/Users/jonathan/Documents/audio/juce/jon/OSL-Side-Effects/_dev/Builds/MacOSX/OSL-Side-Effects.xcodeproj", "-alltargets", "-configuration", "Release", "SYMROOT=~/Library/Developer/Xcode/DerivedData"
],
"group": {
"kind": "build",
"isDefault": false
}
}
]
}
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/Applications/REAPER64.app/Contents/MacOS/REAPER",
"args": ["-cfgfile","/Users/jonathan/Library/Application Support/REAPER/reaper.ini"],
"stopAtEntry": false,
"cwd": "/Applications/REAPER64.app/Contents/MacOS",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"preLaunchTask": "build Debug"
}
]
}
