Sample Header Ad - 728x90

Is there a Mac-native equivalent of xvfb for running on a headless Mac server?

17 votes
2 answers
18661 views
I'm attempting to automate some tests of a GUI application on a headless Mac. I'm able to run theses tests from the terminal on a desktop Mac, and there's no issues and they run as expected (without popping up a window). However, when I attempt to run them on a headless server, I'm not able to get them to work. They error out with issues related to getting a display. (Specifically, CGLChoosePixelFormat() is returning an error.) For our Linux platform tests, we've had similar issues, and can solve that by using [xvfb](https://en.wikipedia.org/wiki/Xvfb) to create a "virtual" display. Looking around, it does seems like it is possible to use xvfb itself on Mac ... if you install a whole X display subsystem first. This seems rather suboptimal to me. Ideally, I'd like to test on Mac using the same display system a regular Mac uses, not a different, testing-only display system. Is there an equivalent to xvfb for the native Mac display? That is, is there a way to launch a "virtual" display on a headless Mac server?
Asked by R.M. (281 rep)
Jul 25, 2018, 04:08 PM
Last activity: Mar 27, 2022, 09:22 PM