How to debug electron production binaries

Lucca picture Lucca · Aug 3, 2017 · Viewed 12.5k times · Source

I can't open devtools in the built version of my electron app. Therefore i want to find another solution to log any errors that only occur in the production version.

Is there any good way to get some console.logs from an electron application if its already built? Obviously i can debug the “development” version (running npm run dev) of my electron app by opening the chrome dev tools. But i can’t find any way to enable them inside my production application. I am using the newsest version of electron-vue

Thanks for any help in advance.

Answer

Tim Osadchiy picture Tim Osadchiy · Jun 17, 2019

Here's what worked for me on Mac.

  1. In terminal type lldb path/to/build.app
  2. In the opened debugger type run --remote-debugging-port=8315. It should open a window of your app.
  3. Open Chrome at http://localhost:8315/
  4. Click on the name of the app. For example, Webpack App.
  5. If you don't see anything in the opened tab, focus on the window of your app.