Xcode playground gets stuck on 'Running playground' or 'Launching simulator' and won't run the code, what to do?

前端 未结 22 929
情歌与酒
情歌与酒 2020-12-22 16:03

Every time I create a new playground in order to test some code, Xcode gets stuck and won\'t run the code. It simply presents \'Running playground\' or \'Launching simulator

22条回答
  •  时光取名叫无心
    2020-12-22 16:12

    As if this question didn't have enough answers, I will provide my "solution" to the stuck Swift playgrounds problem:

    The one solution I've come across which works nicely for me (so I do not have to restart Xcode):

    killall launchd_sim
    

    This will cause the spinning "Running Playground..." to go away and you can trigger a new execution. Be aware: the next execution is going to spin up launchd_sim and all those child processes again. It would probably be best to kill only the relevant child process. But I didn't find it so far.

    But I do this only when I'm not using the iOS Simulators in parallel, as the launchd_sim process is a child process of Simulator.

提交回复
热议问题