# Debugging

Source: https://docs.interop.io/desktop/developers/debugging/index.html

## Guide

To start debugging your **io.Connect Desktop** app in Visual Studio Code, execute the following steps:

1. Start **io.Connect Desktop** with the `--remote-debugging-port` command line argument and specify a debugging port:

```cmd
io-connect-desktop.exe --remote-debugging-port=9222
```

Using the `--remote-debugging-port` command line argument instructs **io.Connect Desktop** to listen on the specified port for a debug connection.

2. Add a new section to the `launch.json` file of Visual Studio Code with the following configuration:

```json
{
    "name": "io.Connect: Renderer",
    "type": "chrome",
    "request": "attach",
    "targetSelection": "pick",
    "port": 9222,
    "webRoot": "${workspaceFolder}",
    "timeout": 30000
}
```

> ⚠️ *Note that the port number in the `launch.json` configuration must be the same as the one specified in the `--remote-debugging-port` command line argument for starting the **io.Connect Desktop** executable file.*

3. Start your app. To debug your app locally, start your app on `localhost` or other development server and update the `"url"` property in your [app definition](https://docs.interop.io/desktop/developers/configuration/application/index.md) with the respective `localhost` or development server URL.

4. Select the `io.Connect: Renderer` profile from "Run and Debug" in Visual Studio Code.

5. Select your app tab and start debugging.
