captureScreen quits simulator on Mac (M1)

local function doIt()
local screenCap = display.captureScreen(), {time = 500, onComplete = function() display.remove(screenCap) screenCap = nil end})
local pressIt = display.newRect(100, 100, 110, 90)
pressIt:addEventListener(“touch”, doIt)

It may take one or several times to execute function for simulator to quit. In console I am getting “Finished in 6.8s with exit code -11”.

Though on Windows it works fine. I don’t know this is Mac M1 problem or it happens on all Macs. Can someone test it?

Any Mac owners? Just to be sure that there is nothing wrong on my end.

I have a non-M1 mac (2019 Mac Mini) and it happens on that too, though not every time. In fact it can cause my entire Mac to crash, my ‘workaround’ is to just make sure I never try and call screenCapture in the sim.

This wasn’t a problem on my old Mac but I’m now crashing all the time on a new one. Did you ever find a solution other than not screenshotting in the simulator?

No, I never found one. I’ve got a new Mac Mini since then (an M2 model) and that seems to be ok the few times I’ve tried, but I rarely do it out of fear of it crashing. A colleague recently tried it on his Macbook (intel model I think) and it crashed for him too.