> ## Documentation Index
> Fetch the complete documentation index at: https://docs.directgvr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Debug the CEF client with VS Code

> Attach the Visual Studio Code JavaScript debugger to your launcher skin.

If your team uses [Visual Studio Code](https://code.visualstudio.com/), you can debug your CEF launcher skin with its JavaScript debugger. This builds on [Test a launcher skin with the CEF debugging console](https://docs.directgvr.com/troubleshooting/cef-debugging-console.md).

## Requirements

* The DirectGVR client binary (`host.exe` or `host.app`)
* The CEF binaries and libraries next to `host.exe` or inside `host.app`
* Your launcher skin
* Visual Studio Code 1.6 or newer, which includes the JavaScript Debugger

## Set up the client and skin

Collect `host` and the CEF files in a test folder as described in [Test a launcher skin with the CEF debugging console](https://docs.directgvr.com/troubleshooting/cef-debugging-console.md). Note the path to your skin.

For React skins, start the Node web server first with `npm run start` or `yarn run start`, and note the port it shows.

## Create launch.json

1. In VS Code, open your skin folder.
2. Select **Run → Add Configuration → Chrome**.
3. Replace the generated code with the configuration for your setup below.
4. Save the file as `launch.json`. VS Code creates a `.vscode` folder.

Set `runtimeExecutable` to the full path of the host executable and `--skin` to your skin folder. On macOS, the executable is inside the app at `host.app/Contents/MacOS/host`.

```json Angular skin, Windows theme={null}
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "pwa-chrome",
      "request": "launch",
      "name": "Launch DIRECT",
      "port": 9222,
      "runtimeExecutable": "c:/path/to/host.exe",
      "runtimeArgs": [
        "--window",
        "--debugfile",
        "--disablesecurity",
        "--devtools",
        "--cef",
        "--skin=c:/path/to/launcher-skin"
      ]
    }
  ]
}
```

```json Angular skin, macOS theme={null}
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "pwa-chrome",
      "request": "launch",
      "name": "Launch DIRECT",
      "port": 9222,
      "runtimeExecutable": "/Users/<you>/direct/host.app/Contents/MacOS/host",
      "runtimeArgs": [
        "--window",
        "--debugfile",
        "--disablesecurity",
        "--devtools",
        "--cef",
        "--skin=/Users/<you>/direct/launcher-skin"
      ]
    }
  ]
}
```

```json React skin, Windows theme={null}
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "pwa-chrome",
      "request": "launch",
      "name": "Launch DIRECT",
      "port": 9222,
      "runtimeExecutable": "C:/Users/<you>/direct/host.exe",
      "runtimeArgs": [
        "--window",
        "--debugfile",
        "--disablesecurity",
        "--devtools",
        "--cef",
        "--skip-selfupdate",
        "--devserver=http://127.0.0.1:3005/",
        "--skin=C:/Users/<you>/direct/launcher-react/public"
      ]
    }
  ]
}
```

```json React skin, macOS theme={null}
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "pwa-chrome",
      "request": "launch",
      "name": "Launch DIRECT",
      "port": 9222,
      "runtimeExecutable": "/Users/<you>/direct/host.app/Contents/MacOS/host",
      "runtimeArgs": [
        "--window",
        "--debugfile",
        "--disablesecurity",
        "--devtools",
        "--cef",
        "--skip-selfupdate",
        "--devserver=http://127.0.0.1:3005/",
        "--skin=/Users/<you>/direct/launcher-react/public"
      ]
    }
  ]
}
```

> [!NOTE]
>
> For React skins, change only the port in `--devserver` to the one Node shows. Leave `"port": 9222` as it is.

## Start debugging

Select **Run → Start Debugging** or press **F5**. VS Code starts the client and attaches the debugger.

## Related

* [Test a launcher skin with the CEF debugging console](https://docs.directgvr.com/troubleshooting/cef-debugging-console.md)
* [VS Code browser debugging](https://code.visualstudio.com/docs/nodejs/browser-debugging)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.