Skip to content

Files

Latest commit

author
Eimi Okuno
Nov 2, 2019
f4c8ce8 · Nov 2, 2019

History

History
48 lines (35 loc) · 1.23 KB

electron-debug.md

File metadata and controls

48 lines (35 loc) · 1.23 KB

Debugging Electron

Site Point article

Renderer

Use Chrome Debugger Tool.

Debug the renderer process using the Chrome Debugger Tool by using the shortcut Option + Command + I Apparently you can also disable this if you want by customising your menu.

Main process

Electron's Inspect

Use Electron's debug option by passing the --inspect option, like so:

electron --inspect=5858 your/app

VSCode

Use VS Code

Add the following to VSCode, as .vscode/launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug Main Process",
      "type": "node",
      "request": "launch",
      "cwd": "${workspaceFolder}",
      "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
      "windows": {
        "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
      },
      "args" : ["."],
      "outputCapture": "std"
    }
  ]
}

Then start adding breakpoints in your application, and run debug in VSCode.