Split up debugging-main-process.md, add electron-inspector guide
- Move the debugging guides for VSCode and node-inspector into separate files. - Add instructions for using electron-inspector to the node-inspector guide. - Remove note in node-inspector guide about crashing when inspecting `process` (it was fixed a long time ago: https://github.com/nodejs/node-v0.x-archive/issues/8205)
This commit is contained in:
parent
85702604c3
commit
762a5bbefa
3 changed files with 180 additions and 101 deletions
34
docs/tutorial/debugging-main-process-vscode.md
Normal file
34
docs/tutorial/debugging-main-process-vscode.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Debugging the Main Process in VSCode
|
||||
|
||||
### 1. Open an Electron project in VSCode.
|
||||
|
||||
```bash
|
||||
$ git clone git@github.com:electron/electron-quick-start.git
|
||||
$ code electron-quick-start
|
||||
```
|
||||
|
||||
### 2. Add a file `.vscode/launch.json` with the following configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Debug Main Process",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
|
||||
"program": "${workspaceRoot}/main.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Note:** For Windows, use `"${workspaceRoot}/node_modules/.bin/electron.cmd"` for `runtimeExecutable`.
|
||||
|
||||
### 3. Debugging
|
||||
|
||||
Set some breakpoints in `main.js`, and start debugging in the [Debug View](https://code.visualstudio.com/docs/editor/debugging). You should be able to hit the breakpoints.
|
||||
|
||||
Here is a pre-configured project that you can download and directly debug in VSCode: https://github.com/octref/vscode-electron-debug/tree/master/electron-quick-start
|
Loading…
Add table
Add a link
Reference in a new issue