Standardize debug main process
This commit is contained in:
parent
96bb9b2757
commit
0e4ae6f864
1 changed files with 11 additions and 10 deletions
|
@ -1,25 +1,26 @@
|
||||||
# Debugging the main process
|
# Debugging the Main Process
|
||||||
|
|
||||||
The devtools of browser window can only debug the renderer process scripts.
|
The browser window devtools can only debug the renderer process scripts (i.e.
|
||||||
(I.e. the web pages.) In order to provide a way to debug the scripts of
|
the web pages). In order to provide a way to debug the scripts from the main
|
||||||
the main process, Electron has provided the `--debug` and `--debug-brk`
|
process, Electron has provided the `--debug` and `--debug-brk` switches.
|
||||||
switches.
|
|
||||||
|
|
||||||
## Command line switches
|
## Command Line Switches
|
||||||
|
|
||||||
|
Use the following command line switches to debug Electron's main process:
|
||||||
|
|
||||||
### `--debug=[port]`
|
### `--debug=[port]`
|
||||||
|
|
||||||
When this switch is used Electron would listen for V8 debugger protocol
|
When this switch is used Electron will listen for V8 debugger protocol
|
||||||
messages on `port`, the `port` is `5858` by default.
|
messages on `port`. The default `port` is `5858`.
|
||||||
|
|
||||||
### `--debug-brk=[port]`
|
### `--debug-brk=[port]`
|
||||||
|
|
||||||
Like `--debug` but pauses the script on the first line.
|
Like `--debug` but pauses the script on the first line.
|
||||||
|
|
||||||
## Use node-inspector for debugging
|
## Use node-inspector for Debugging
|
||||||
|
|
||||||
__Note:__ Electron uses node v0.11.13, which currently doesn't work very well
|
__Note:__ Electron uses node v0.11.13, which currently doesn't work very well
|
||||||
with node-inspector, and the main process would crash if you inspect the
|
with node-inspector, and the main process will crash if you inspect the
|
||||||
`process` object under node-inspector's console.
|
`process` object under node-inspector's console.
|
||||||
|
|
||||||
### 1. Start the [node-inspector][node-inspector] server
|
### 1. Start the [node-inspector][node-inspector] server
|
||||||
|
|
Loading…
Reference in a new issue