Sometimes when working on Xcode Playground you may experience some unexpected behavior where Playground gets stuck on ‘Running…’ without any obvious reason. 🤷
The root cause of this issue is Xcode trying to run the code on a simulator. By default, when creating a Playground, Xcode will set the platform to iOS and it will open a simulator to run the code.
So, if you are not working on iOS-specific code, you can solve this by switching the platform on the Playground Settings to
You can change that on the File Inspector tab, which you can either access from the Inspector area or by using the shortcut Command (
⌘) + Option (
⌥) + 1.
With that change in place, your Playground will compile and run successfully