渲染进程可直接 打开:开发者工具 mac快捷键:option+command+i
以下是主线程调试 VSCode:参考资料使用 VsCode调试 | Electron
1,如下图选择运行与调试按钮:创建 launch.json
路径:根目录/.vscode/launch.json
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" : ["."]
}
]
}
2,执行 选择debug Main Process 点击绿色三角形运行
调试简单,以上就这么多。有问题留言