Update docs for new --inspect support

This commit is contained in:
Kevin Sawicki 2017-05-15 09:34:55 -07:00
parent a33643c518
commit 690b2e91c4
2 changed files with 9 additions and 140 deletions

View file

@ -3,31 +3,31 @@
The DevTools in an Electron browser window can only debug JavaScript that's
executed in that window (i.e. the web pages). To debug JavaScript that's
executed in the main process you will need to use an external debugger and
launch Electron with the `--debug` or `--debug-brk` switch.
launch Electron with the `--inspector` or `--inspector-brk` switch.
## Command Line Switches
Use one of the following command line switches to enable debugging of the main
process:
### `--debug=[port]`
### `--inspect=[port]`
Electron will listen for V8 debugger protocol messages on the specified `port`,
Electron will listen for V8 inspector protocol messages on the specified `port`,
an external debugger will need to connect on this port. The default `port` is
`5858`.
```shell
electron --debug=5858 your/app
electron --inspect=5858 your/app
```
### `--debug-brk=[port]`
### `--inspect-brk=[port]`
Like `--debug` but pauses execution on the first line of JavaScript.
Like `--inspector` but pauses execution on the first line of JavaScript.
## External Debuggers
You will need to use a debugger that supports the V8 debugger protocol,
the following guides should help you to get started:
You will need to use a debugger that supports the V8 inspector protocol.
You can use Chrome to connect a debugger by visiting `chrome://inspect`
and selecting to inspect the launched Electron app present there.
- [Debugging the Main Process in VSCode](debugging-main-process-vscode.md)
- [Debugging the Main Process in node-inspector](debugging-main-process-node-inspector.md)