问题
Is it possible to show the dev tools within a built electron app? The executable that I built using electron-packager
is behaving differently from the app run using electron
at the command line, and I have no way to see what kinds of exceptions are being thrown.
回答1:
Yes it's possible to show the DevTools in a packaged app, just call someBrowserWindow.webContents.openDevTools()
. If you want a menu item and/or keyboard shortcut to do it then you'll need to create and set your own menu for the browser window using someBrowserWindow.setMenu(someMenu)
.
来源:https://stackoverflow.com/questions/35518984/how-to-get-dev-tools-in-built-electron-app