local function doIt()
local screenCap = display.captureScreen()
transition.to(screenCap, {time = 500, onComplete = function() display.remove(screenCap) screenCap = nil end})
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?