Debugging 编译的Electron应用程序中的调试器

Debugging 编译的Electron应用程序中的调试器,debugging,exe,electron,Debugging,Exe,Electron,我需要在编译的Windows应用程序(Electron应用程序)中使用chrome调试器 My main.js: const electron = require('electron') require('electron-debug')({showDevTools: true}); const app = electron.app const BrowserWindow = electron.BrowserWindow const path = require('path') const u

我需要在编译的Windows应用程序(Electron应用程序)中使用chrome调试器

My main.js:

const electron = require('electron')
require('electron-debug')({showDevTools: true});
const app = electron.app
const BrowserWindow = electron.BrowserWindow

const path = require('path')
const url = require('url')

let mainWindow

function createWindow () {

  mainWindow = new BrowserWindow({width: 800, height: 800})
   mainWindow.loadURL('https://camservices.prointernet.com/client.html');

  mainWindow.on('closed', function () {

    mainWindow = null
  })
}
app.on('ready', createWindow)
app.on('window-all-closed', function () {

  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', function () {

  if (mainWindow === null) {
    createWindow()
  }
})
但调试器不会显示在已编译的应用程序上。

根据,您可以通过添加
enabled
属性强制调试器显示在生产应用程序中

require('electron-debug')({showDevTools: true, enabled: true});