13 Replies
      Latest reply on Aug 24, 2018 9:08 AM by jhedgespeth
      ChrP Level 1 Level 1 (0 points)

        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.

        • Re: Swift Playground hangs on Xcode/High Sierra fresh install
          KMT Level 9 Level 9 (14,875 points)

          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.

            • Re: Swift Playground hangs on Xcode/High Sierra fresh install
              ChrP Level 1 Level 1 (0 points)

              I do not understand why there would be an issue with the hardware, it's not bad specs considering the newer machines are not significantly better.  Newer generation i5, but still i5.  8gb ddr3 instead of 4gb ddr3.  SSD instead of SATA.

               

              Is there any way to debug the application or does it just require buying a new machine?

                • Re: Swift Playground hangs on Xcode/High Sierra fresh install
                  KMT Level 9 Level 9 (14,875 points)

                  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.

                  1 of 1 people found this helpful
              • Re: Swift Playground hangs on Xcode/High Sierra fresh install
                svein2re Level 1 Level 1 (0 points)

                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....

                • Re: Swift Playground hangs on Xcode/High Sierra fresh install
                  jrmills Level 1 Level 1 (0 points)

                  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.

                  • Re: Swift Playground hangs on Xcode/High Sierra fresh install
                    gbfrodo Level 1 Level 1 (0 points)

                    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!!!

                    • Re: Swift Playground hangs on Xcode/High Sierra fresh install
                      bennett12349 Level 1 Level 1 (0 points)

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

                      • Re: Swift Playground hangs on Xcode/High Sierra fresh install
                        pevj62 Level 1 Level 1 (0 points)

                        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

                        • Re: Swift Playground hangs on Xcode/High Sierra fresh install
                          jhedgespeth Level 1 Level 1 (0 points)

                          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.