Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug electron production

Tags:

electron

I can't open chrome dev tools in my built electron app using electron packager.

I have tried mainWindow.webContents.openDevTools() but this didn't work.

Looking online and at other SO answers, I came across commenting out rendererConfig.devtool = '' and webConfig.devtool = '' but this didn't make a difference either.

I have also tried adding a key shortcut to open the dev tools but this did nothing.

I am using the latest version of electron.

Thanks for any help in advance.

like image 702
Doto Pototo Avatar asked Sep 01 '26 08:09

Doto Pototo


1 Answers

I figured out that one way to debug the production app is run the .exe from a terminal with the argument --remote-debugging-port=8315. This will allow debugging by going to http://localhost:8315/ in chrome.

like image 122
Doto Pototo Avatar answered Sep 04 '26 17:09

Doto Pototo