Mac: Surefire way to restart Playdate Simulator

No doubt due to some abuse of mine (developing C-games that crash the simulator), my simulator can get in state where it is unresponsive, just won't die and won't properly restart. In this case it will keep bouncing in the Dock as if it is trying to start.

What I tried was this:

ps aux > process.txt

(find pid in processes.txt: 12475)

ninovanhooff     12475   0.0  0.0        0      0   ??  ?E   10:11PM   0:00.00 (Playdate Simulat)

The above is the only entry for the playdate simulator, while a healthy entry looks like this

ninovanhooff     84192   0.0  0.4 412526832 138848   ??  S     6:20PM   0:00.65 /Users/ninovanhooff/Developer/PlaydateSDK/bin/Playdate Simulator.app/Contents/MacOS/Playdate Simulator

kill -9 12475

Even this will not properly kill the simulator, even if it is supposed to be more powerful than Force Quit.

To be able to restart the sim, I have to log out of my mac and log back in.

Is there a way to reset the simulator state so I don't have to through this?

That's an odd one. The Sim isn't doing anything too magical, I'm not sure why macOS wouldn't be able to kill it/restart it. Have you tried killing it from Activity Monitor?

Yeah, tried that already. Is there something like a lock file or a config/state file that I could delete to force a safe/fresh start?

The only time I get this is if debugger is attached to the Simulator.

Force quit works there, but the polite way is to resume through the debugger interface.

But your issue sounds different? No debugger connection?

1 Like

Yeah that's right. I bet some invalid operation caused by my code is the cause but I don't know how what that would be.

But thanks for sharing the detailed case :blush:

OK, it has something to do with the way you open the app:

Working:

"/Users/ninovanhooff/Developer/PlaydateSDK/bin/Playdate Simulator.app/Contents/MacOS/Playdate Simulator" ./wheelsprung.pdx

App bouncing forever in the dock when it was left in a bad state:

open ./wheelsprung.pdx

That is very odd (and not being caused by us). When it gets into the hung state, is there a Simulator process listed in Activity Monitor? If yes, can you Sample it and attach the sample?