使用 VsCode调试

    1. 在 VSCode 中打开一个 Electron 项目。

    2. 添加具有以下配置的文件 .vscode/launch.json

    3. 调试

    main.js中设置一些断点,并在 中开始调试. 您应该能够击中断点。

    If you want to build Electron from source and modify the native Electron codebase, this section will help you in testing your modifications.

    Configuration Notes

    • requires the built-in C/C++ extension be enabled.
    • your-executable-location will be one of the following depending on a few items:
      • Testing: If you are using the default settings of or the default instructions when building from source.
      • : If you built a Release build rather than a Testing build.
      • your-directory-name: If you modified this during your build process from the default, this will be whatever you specified.
    • The args array string "your-electron-project-path" should be the absolute path to either the directory or main.js file of the Electron project you are using for testing. In this example, it should be your path to .

    3. 调试