Playgrounds get stuck "Running..."

This is annoying to a point where Playgrounds are basically useless. Happens to me all the time. Best MBP and all the latest versions.

Defeats the whole purpose of Playgrounds if it takes minutes to get them running. Have to quit Xcode all the time.

It may help to set manual execution mode (the square at the bottom).

Hi Mic,

Same issue for me, my Playground get stuck as soon as an error comes in as:

error: Execution was interrupted, reason: signal SIGABRT.

The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.

Need to quit and relaunch and at relaunch long time with Lauching Simulator...

Really disappointing.

Could test 9.4 beta2:



Playgrounds

Addressed an issue that would cause Xcode to hang when using Playgrounds. (37822125)


The feature is broken on 9.4 Beta 2 as well! I've attempted to use the beta in hopes the problem would have been rectified but much like iTunes, xCode's playground has quickly become the step-child of Apples pet projects. Sigh!

Playgrounds working again for me in Version 9.3.1 (9E501).

Would have to agree with you Mic - the playground in 9.3.1 hangs on "Running" incesantly and when I installed the 9.4 beta guess what - same thing. Was excited to use the playground yet it 100% useless and a waste of time.

Did you check whether XCode 10 solves those issues ?

Under Xcode 10 I can't execute anything at all. I click the play button, it says "Running" then it just stops - nothing happens. Is anyone else experienceing this?

Yep, with Xcode 9.4 on High Sierra latest versions, I'm trying to prototype some SceneKit code in a macOS playground. My machine is a MacbookPro Retina (early 2013), 8gb ram.


It's so unstable I have to restart Xcode (if it hasn't crashed and restarted itself) at least once an hour.


I find that:

1. Saving files triggers crashes.

2. Editing anything other than the main playground entry code does not cause the playground to recompile automatically or quickly.

3. If an error exists in anything other than the main playground entry code, you get this stupid modal dialog on the screen with "The auxiliary source module did not compile successfully." as the message. Just show me the error messages inline like any other compilation issue, thanks. And when I have two displays, that dialog insists on showing on the primary display, not the one with Xcode (which I run on the larger, secondary display).

4. Code completion both automatic, and via the ESC key does not work in anything other than the main playground entry code.

5. I see a lot of these SIGTERM errors after watching the beachball for 30 seconds.


"error: Execution was interrupted, reason: signal SIGTERM.

The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation."


Honestly, the whole "swift" experience is painful. I can try reworking my playground into a mac app to see if it's more stable. God forbid kids actually try to learn with this stuff. It will turn people away.


[EDIT] I've just taken my code out of the playground and copied it into a new macOS.game project. Same code with the only tweaks being the game view initialisation stuff that had to change slightly. Now, the thing runs first time, every time. So I've wasted all this time on Playgrounds which are slower to compile, less intuitive to use, can't be debugged, etc when I could simply be running the app natively and quickly on the mac.

I'm having the same problem with Xcode 10.1 on MacBook Air. Stuck on "Running" and code will not execute. Even the tutorial playgrounds by Apple won't run. Does anyone have a fix for this?

Did you try changing to manual execution ?

I found that if I strart the day (before I open any apps) with a playground app that I am working on it loads and runs after a bour 3 - 4 mins and remains stable after that.

If I try to open a playground with xCode and the xCode Simulator open playground sticks in the "Running" mode forever!

Same here in Xcode 11.4. It's a even a macOS playground so I don't think it needs a Simulator. Playgrounds are such a cool idea, but I don't think I've gotten one to work for more than 5 minutes since they were released in 2014. Apparently there is nothing I can "kill" in the Activity Monitor app? I just have to restart Xcode. It ends up being easier to write command line test programs or small iOS apps.

Same problem at September 2020. Xcode 11.7. Mac OS Catalina 10.15.6
Me too. Upgraded to Big Sur beta (11) to see whether this would go away. It didn't. Downgraded back to Catalina 10.15.7 with a clean install through a thumb drive, a fresh Xcode install from the AppStore. Nothing works. Still stuck in the "Running..." bug

I'm on a 2017 iMac 3.4GHz with 8 GB of RAM
I've had luck when I stopped my multipass VMs (A Ubuntu VM orcchestrator which has been adapted for the new virtualisation API). I would assume something like Docker or some other VM software could be interfering with this.
An iOS playground appears to perform better than a MacOS one. It still takes too long to run in my opinion but at least iOS seems to work.

Edit: I'm on Xcode 12.2

Same problem on Xcode 12.2,

it was working fine for a few minutes, and then it just stops. It won't print anything on the console, but it does still tell me where I make mistakes.

I left it running for like an hour now and still nothing. I restarted Xcode multiple times and it doesn't fix anything for me!

Apple if you are reading this, this is a major problem that you have to fix as soon as possible! I use playgrounds all the time to test my codes and ever sense I got Xcode 12 it just won't work properly.

im on a MacBook Air (Retina, 13-inch, 2019) with Big Sur version 11.0.1
I got a work around with live view. If you press
opt + command + Enter, you should see the real time result.

Not really the solution but at least a bandaid one.

Having the same issue December 2020. Really simple codes not running after 5+ minutes of spinning wheel.

Xcode 12.2
macOS Big Sur 11.0.1

Macbook Pro, Retina, early 2015,3.1 GHz Dual-core Intel Core i7, 16 GB Memory
This is my playground:

Code Block Swift
import Foundation
let uuid = UUID().uuidString


I've been waiting minutes for output. I even set it to be a macOS platform as I'm told this speeds up compile and execution times.

My issue was going back to the playground file after a while the playground was running for ever. I just clicked stop playground in the editor menu and then clicked run... it solved my issue for me.
Just had the same issue on Big Sur. 27" iMac 2017 3.4 Ghz i5, 8GB model. Xcode 12.4

Fixed it by creating a new playground > Selecting macOS instead of iOS. > Save File Name (example1.playground)

I can confirm that choosing iOS instead of macOS is the issue, as I created another iOS playground and it doesn't run.

Hope this helps!

I'm using Xcode 13 Beta 4 and still running into this. I found another workaround (I'll use MacOs playground when possible).

Whenever I accidentally hit an infinite loop (happens a lot doing DP problems :) ) and hit the Square in the lower left to Stop I'm doomed.

Once stuck in this state, even if you kill Xcode when you open it, it immediately starts running again (with the bad code). Even if I fix the code, it just starts up and gets stuck.

My project is in GIT and noticed this difference in the project (contents.xcplayground)

It adds and sets a flag executeOnSourceChanges='true', I just revert that change and I'm good to go. Also if I do run into an infinite loop and just kill Xcode rather than try to stop it, that also avoids the problem.

This is the Diff of contents.xcplayground (this file is inside your playground project "content folder")

I might try adding that attribute and set it false and see if that prevents it from getting set true. Rather than absent.

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<playground version='5.0' target-platform='ios' buildActiveScheme='true' importAppTypes='true'>
+<playground version='5.0' target-platform='ios' buildActiveScheme='true' executeOnSourceChanges='true' importAppTypes='true'>
     <timeline fileName='timeline.xctimeline'/>
 </playground>

11-04-2021, Xcode 13.1 (13A1030d), MBP M1/16/512 I have to admit: the bug is still there...

Playgrounds get stuck "Running..."
 
 
Q