Swift Playground hangs on Xcode/High Sierra fresh install

Xcode Swift playground hangs with the "Hello, playground" sample script without displaying the result to the right.

It hangs with the spinning wheel at the top either saying "Launching Simulator" or "Running MyPlayground1"


I had this problem before and stopped using Xcode for developing (I don't use GUI to code generally), but tried again today after having a fresh install of High Sierra and then Xcode 9.2 (really no other apps, just iCloud syncing documents).


Computer:

MacBookPro Early 2011

2.3 GHz Intel Core i5

4gb 1333 DDR3

SATA HD


OS:

10.13.3 installed today (same issue previously on Sierra)


Code:

"

import UIKit

var str = "Hello playground"

"


Would be willing to buy more RAM if that is the definitive answer.


Also willing to debug, but I'm not getting any errors and not sure what system log/ application log this would show up in.


I assume this is is likely a hardware compatibility issue since I reproduced the error on a new OS/ Xcode install, but would like to know how to get around it if possible.

Accepted Reply

This thread has been deleted

It's not a hardware issue as much as a general performance issue. I'd at least max the ram, even if I weren't using Xcode, which should be no more than $80. Apple engrs. tell us Xcode favors max ram and a fast SSD.


You'll be out $300~$500 if you go for both, and still have a 7 yr. old design chassis and a small screen. That's $500 (plus whatever could be earned if the MB was sold as-is), you could put towards a newer system, w/16~32GB ram, etc. that you won't be questioning so much, every time you run Xcode. Tip - Be sure to keep several tens GB free on the drive at all times. How much free space is on your drive right now?


Another factor surrounds what types of apps you intend to work with. Apple announced back in 2015 that Metal support in OS X, as an example, extends to Macs only built since 2012.


But again, Xcode 9's performance is the main problem, so regardless of what you decide, best to keep expectations low.


And speaking of performance/specs, geekbench should have comparisons you can reference.


Good luck.

Replies

4 GB ram - ouch.


Xcode 9 is a burden for many devs, regardless of hardware, and while more ram and a fast SSD would help, I wouldn't bother putting $$ that machine at all. It's had a good run, but it's past time to pasture it if you want to keep your IDE up to date.

I had the same problem, running an example playground saved on my desktop.

I moved the playgroundfile to another location on my local harddrive and xcode became responsive again (after restarting xcode)


It could possibly have something to do with the fact that my Desktop is synced to iCloud, because when I loaded my playground (before relocating), I was warned that the file had been downloaded from internet and did I really want to load it? In fact the playground file had been constructed manually from scratch 5 minutes earlier, and the only internet connection possible would be iCloud. Just a guess though....

Seems like the machine/OS config could be relevant:


Macbook pro (Retina 13" Early 2013)

Processor 3 GHz IntelCore i7

Memory: 8 GB

macOS High Sierra v 10.13.3

I have just installed Xcode 9.3 on a late 2014 iMac 27" with 16G RAM and a fusion drive. I am just starting to learn Swift so I may be missing something on preferences but the playground is sporadically responsive at best in terms of reflecting the values in variables and refreshing the debug area. The only solution I've found after modifying a line of code is to shut down Xcode and restart it. Then sometimes it works for a few changes. Activity Monitor shows only 9GB of the 16G used.


Any suggestions gratefully accepted.

Cant be hardware issue. I have:


iMac (Retina 5K, 27-inch, 2017)

Processor 4.2 GHz Intel Core i7

Memory 16 GB 2400 MHz DDr4

running macOS High Sierra Version 10.13.4


Xcode Version 9.3(9E145)


I never had any problems with playgrounds (or Xcode hanging for that matter) until the latest software updates of Xcode.


I have been saving playgrounds on a Lexar 140G USB 3.0 flash drive.

I did have some success with the playground hanging for 2 hours after disconnecting wireless devices from Xcode but that was as long as it lasted.

I feel its definately a software issue with Xcode and or macOS.

Come guys at Apple get on this issue and fix it Many Many reports have been sent in to you. its not like you lack the resourses to fix things.

We pay a premium for your products and still this problem exists!!!

Willing to learn Swift and this is a major obstacle on my journey, just feeling down about it. Started to use online compiler, eager to see a fix from apple.

Same problem. 2017 iMac 16G RAM. Only solution for me is to change to manually running the playground by clicking and holding on the run arrow at the bottom. Apple makes it hard for beginners like me.

I had the same problems and moving file from desktop fixed the problem.

For me this steps solved this problem:


Try this

close the xcode

open the xcode

go to xcode/windows/ Devices and Simulators/

choose the Iphone 5s


open your Playground

I spent the past several days trying to get Xcode 9.4 to work. It crashes constantly as soon as a syntax error occurs as you are typing a line of code. I submitted a ticket with Apple and they said it was a bug. None of the workarounds that I found on the web work. The details of the help ticket is below. I don't see how anyone can use Xcode 9 and Swift 4.


PLATFORM AND VERSION
OS X
MacBookPro12,1 Intel Core 95 8 GB memory. The OS is macOS 10.13.6 Darwin 17.7.0

DESCRIPTION OF PROBLEM
Xcode 9.4.1 hangs when running simple IOS code from the Intro to App Development Curriculum by Apple. I am simulating an iPhone 5s phone.

STEPS TO REPRODUCE
Go into Xcode

Open any of the Intro to App Development Curriculum projects into the playground.

When an syntax error Xcode hangs. The only fix is to reboot the computer. This happens a lot in developing code.