How to debug packaged app in macOS


#1

So I’m working on implementing updates on my app.

The problem is that autoUpdater in macOS only works with signed apps, which means I need to package the app and run it to test it. This in turn means that I lose console.log() for debugging.

I’ve looked into the Console.app but no messages are printed there from Electron.

So how can I debug a packaged app?


#2

have you tried to unpack the asar file and change to ‘app’ folder?
then you can modify the js file and debug it directly.


#3

Thanks @anurocha I just added a Node env var to be able to build the code without minifying, and then manually enabling the dev tools shortcut.


#4

Sorry to resurrect but I think this can be useful to others. To do this, I run this from the terminal:

open myApp.app/Contents/MacOS/myApp

(found this here)