Where does Simulator store console logs?

The simulator (MacOS) seems to crash very easily (e.g. display.newText{text=nil} will do it) and this makes it impossible to see the stack trace in the simulator console for what is usually a very simple bug. Do the logs get stored somewhere? I can’t find them anywhere in Application Support.

Also open to other suggestions to quickly iterate when dealing with these sorts of errors. (using vscode if that’s relevant) I’m very new to Solar2d/Lua but very experienced as a dev.

Thanks!

Howdy!

My main development machine runs Windows but a few weeks ago folks were asking about this in Discord…

I didn’t check where logs are actually located, but there’s a Corona Terminal application included in the installation (under Resource Library directory) that launches the Simulator instead of the Simulator launching the console. I haven’t tested whether it remains open when the Simulator crashes, but it does remain open after closing the Simulator.

Do note there’s a message on the Corona Terminal window that says it’s “deprecated”, but seems to be working so far.
I did have to copy the Corona Terminal file to the same directory where Corona Simulator.app is located, and allow the app to open from the Security & Privacy window in MACOS.

It was me who was asking in Discord a few weeks ago :grinning:

I managed to get the console output routed to the Terminal app instead of Solar2D’s own console window, but my colleague said that when the simulator crashes it closes the Terminal app too (presumably because that’s the ‘parent’ of the process that is crashing).

If you wanted to try it out though @swaj , this is what I did. Enter this into the Terminal:

defaults write com.coronalabs.Corona_Simulator no-console -bool yes

Then run the sim from Terminal rather than opening the app directly:
"/Applications/Corona-3680/Corona Simulator.app/Contents/MacOS/Corona Simulator" /your/path/to/your/project

Obviously you’ll need to change ‘Corona-3680’ to whichever version you’ve got installed.

1 Like

I remember people having talked about moving Solar2D console output to Sublime and/or Visual Studio Code terminals instead, but I couldn’t find any quick results on it. It should be possible, but I just don’t remember exactly how. Could be a variation of the commands that Alan mentioned above.

I have been experiencing crashes on Apple silicon-based mac, and I believe the next version of Sim Mac should eliminate many crashes.

I also updated VS Code Solar2d extension to support project launching and console log output

2 Likes

@Scott_Harrison perfect! The simulator still hard crashes but the console in vscode captures the log perfectly when run via Solar2D: Launch Project. Thank you!

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.