Electron快速入门之debug

view->toggleDevelpper Tools 本地桌面调试

浏览器debug
"start": "electron --inspect=5858 ."
浏览器上输入:edge://inspect/#devices
进行连接,不太好用

第三种本地ide调试
运行打开配置;launch.json

{
    "version": "0.2.0",
    "configurations": [
      {
        "name": "Debug Main Process", // 配置方案名字, VSCode左下角可以切换配置方案
        "type": "node",
        "request": "launch",
       "cwd":"${workspaceRoot}",
       "runtimeExecutable":"${workspaceRoot}/node_modules/.bin/electron",
       "windows":{
           "runtimeExecutable":"${workspaceRoot}/node_modules/.bin/electron.cmd"
       },
       "args":["."],
        "outputCapture": "std",
      },
    ]
  }

  设置断点,启动就能调试了

posted @ 2021-02-05 01:12  三号小玩家  阅读(724)  评论(0)    收藏  举报
Title
三号小玩家的 Mail: 17612457115@163.com, 联系QQ: 1359720840 微信: QQ1359720840