MacOS Unable to connect to simulator.

I recently switch to a Mac and things generally work fine except after a few test runs in the simulator I eventually start getting "Unable to connect to simulator." errors and have to close the current project in VSCode and reopen it to get it working again.

This happened on Windows once in a while but on MacOS it doesn't take long before I have to reopen the project.

Any hints on how to avoid this?

Pete