Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug electron production binaries

Tags:

electron

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.

like image 780
Lucca Avatar asked Aug 03 '17 13:08

Lucca


People also ask

How do I disable developer tools in Electron?

Disable developer tools in productionThe key-combination CTRL + SHIFT + I (or ALT + CMD + I on Mac) will open the dev tools and enable inspection of the application. It will even enable some degree of modification. Prevent the simple evil maid attack by catching these keypresses and return false .


1 Answers

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.
like image 114
Timur Osadchiy Avatar answered Sep 22 '22 19:09

Timur Osadchiy