Simulator hangs in xvfb

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.

You can see the exact steps being run here:

1 Like

Maybe something related to the X server environment or configuration?
Is your workflow setup able to run glxgears without issues?

not sure if you start clean everytime.. But if the simulator had never ran before on a system it shows and waits on this screen:

when clicking there ok it also does not start the supplied pdx file on commandline but will launch the launcher

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


The ini file was the missing piece! Thank you so much!

For anyone looking to do something similar:

The workflow configuration is: