I'm working on adding some automated testing involving the Playdate C SDK. To actually run the tests, I want to spin up the simulator in a headless environment, run the tests, then exit.
To accomplish this, I'm trying to start the simulator via xvfb in a docker container. However, when I run xvfb-run ../PlaydateSDK-*/bin/PlaydateSimulator playdate_tests.pdx, the simulator just hangs. There is no output to indicate what the problem is, so I'm a bit stuck on the next step.
only after running it a 2nd time it will work as intended (if starting from a clean install) by running the pdx file i supplied to commandline. You probably could go around the issues by making your own copy of /home/[user]/.Playdate Simulator/Playdate Simulator.ini or a copy from your system somehow
i also had to sudo apt-get install libwebkit2gtk-4.0 or it refused to start at all.
Do note this is when i ran and installed the sdk for the very first time in a kubuntu 22.04 vm
One last thing (but not sure it affects headless) i had to use File->exit to "correctfully" close the simulator if i pressed the X button of the window i get a hang.
Also does your test code exit the simulator by calling simulator.exit function somehow ? (see Inside Playdate ) if not the simulator will probably run indefinetly and never stop ?
if you are running a clean install each time on the action you might be running into the thing i mentioned in the beginning where the supplied pdx file is never ran and a nag screen is shown once