https://github.com/gershnik/set-vscode-xcode
A script to enable VSCode native debugging on Mac with Xcode in a non-default location
https://github.com/gershnik/set-vscode-xcode
debugging vscode xcode
Last synced: about 1 year ago
JSON representation
A script to enable VSCode native debugging on Mac with Xcode in a non-default location
- Host: GitHub
- URL: https://github.com/gershnik/set-vscode-xcode
- Owner: gershnik
- License: mit
- Created: 2022-03-29T09:42:01.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-19T00:57:06.000Z (almost 4 years ago)
- Last Synced: 2025-01-02T17:50:10.599Z (about 1 year ago)
- Topics: debugging, vscode, xcode
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# set-vscode-xcode
A script to enable VSCode native debugging on Mac with Xcode in a non-default location.
More info about why this is needed and what it does can be found at [this article](https://gershnik.github.io/2022/03/29/vscode-cpp-debugging-non-default-xcode.html)
To use
* Download `set-vscode-xcode` script somewhere
* Make it executable
```console
chmod a+x set-vscode-xcode
```
* Run it:
```console
./set-vscode-xcode
```
This will configure VScode to use currently default Xcode for debugging. If you use CMake extension and its debugging support, you are all set.
* If you use `launch.json` configurations to debug you will need to set the following in each native configuration
```json
"MIMode": "lldb",
"miDebuggerPath": "${env:HOME}/.vscode-lldb-mi/lldb-mi"
```
This config is fixed and doesn't need to change.
**Important Note #1**: you will need to re-run the script:
1. After C++ extension is updated (usually every time VScode updates itself)
2. If you want to use a different Xcode
**Important Note #2**: the script assumes that VSCode is installed in default location. If it isn't, modify `vsCodeLocation` variable in the beginning.
You can control which Xcode is default by using `xcode-select` command line tool or by going to Xcode's Preferences -> Locations tab and selecting the instance you want in "Command Line Tools" field.
If you want to use non-default Xcode you can run `set-vscode-xcode` with `DEVELOPER_DIR` environment variable set to point to the one you want to use.
Something like
```console
DEVELOPER_DIR=/Path/To/A\ Different/Xcode.app/Contents/Developer ./set-vscode-xcode
```