Forgive me if this is covered somewhere. I can't seem to find it.
I have an app that runs as expected when I launch from my source code via npm run dev. However the packaged app fails to load the necessary local files. I assume this is due to some ipc calls not working out, but I'm not sure how I should go about troubleshooting this since once packaged I no longer have access to the terminal for console.log. Any advice is much appreciated. Thank you!
What OS is this on?
I'd run the app from the terminal, say
Linux: ./myApp
Windows: myApp.exe
macOS [Installed]? (I think): open -a myApp
That should give you access to the main process logs.
Thanks @tribex. I am on OSX and tried your open -a myApp in terminal but it just launches the app and then nothing.
@yourfavorite On macOS I launch the app with a command like
myApp.app/Contents/MacOS/myApp
Or something like that, I can't remember the path to the executable off the top of my head
@MarshallOfSound Thanks!
open myApp.app/Contents/MacOS/myApp (without the -a flag) did the trick for me!
@yourfavorite
Running:
open myApp.app/Contents/MacOS/myApp
will run the app but I discovered that if you do need to pass in command line parameters, they will not show up in the renderer process. To get them to show up, you need to use exec instead of open:
exec myApp.app/Contents/MacOS/myApp --arg arg1=blah1 arg2=blah2
@JohannBlake open has --args to pass arguments through to the app. E.g.
open MyApp.app --args --arg1=1 --arg2=2
On Windows:
Command Prompt
cd path/to/myApp/win-unpacked
myApp.exe
Git Bash
./path/to/myApp/win-unpacked/myApp.exe
Hi,
I have created a package of my ElectronApp and installed it into my local machine.
How can I debug my app's main process when I launch the app from windows->start?
hi,
how do you open in Linux?
See #514 (comment)
Thanks!
Most helpful comment
@MarshallOfSound Thanks!
open myApp.app/Contents/MacOS/myApp(without the -a flag) did the trick for me!