3 Replies
      Latest reply on Oct 15, 2018 4:13 PM by PaulSolt
      christianfromindianapolis Level 1 Level 1 (0 points)

        Currently, I am trying to learn how to program within Xcode. I have been reading the App Development with Swift book, and as such have been trying to use the labs within the book, to help with my understanding of the Swift programming language. However, whenever I try to open one of these labs, my computer screen starts to flicker, with sections of it going black for a second or two. Following this, all of the screen, except the mouse, will freeze completely. The clock freezes, every app freezes, and it will even stop midway through changing desktops. Sometimes, it will freeze indefinitely, and sometimes it will resume after half an hour if not more. I have had to force restart my computer several times as a result of the freezing.


        However, it only happens whenever I open the labs. Nothing else will cause this, and if I quit Xcode before it freezes, everything will go back to normal, so I’m relatively confident it’s not a hardware issue.


        I have deleted the labs, and then reinstalled them from the site, but the problem was not solved by this. I checked in the System information area, and it says in the Developer section that I am running Xcode 9.4.1, of which is correct. I’ve checked the crash reports, and run EtreCheck, so if those are needed I would be happy to provide the results.


        Does anyone know what I should do? Any help would be greatly appreciated. It seems like nobody else is encountering such an issue.


        I'm using macOS High Sierra, with a MacBook, if that helps.

        • Re: Xcode Playgrounds causes full system hang when running labs
          eskimo Apple Staff Apple Staff (12,015 points)

          This is almost certainly a bug in the OS; non-privileged apps, like Xcode, should not be able to scramble the OS so badly that you have to restart [1].  Regardless of what else you do, my recommendation is that you file a bug about this.

          It’d be very helpful if you could include a sysdiagnose log with your bug report, initiated shortly after the system starts misbehaving.  You can learn more about sysdiagnose logs on our Bug Reporting > Profiles and Logs page.

          Of course it may be tricky to trigger a sysdiagnose log while the system is in this state.  You have a couple of options for this:

          • There’s a hot key that will trigger the log, described in the instructions I referenced above.

          • If that doesn’t work then you should SSH into the machine from another machine before reproducing the problem.  You can then run sysdiagnose via that SSH session.

          As far as workarounds are concerned, here’s some suggestions from least-to-most intrusive:

          • Try creating a new user (via System Preferences > Users & Groups), just in case there’s something about your user account that’s triggering this.

          • Try with Xcode 10.0 GM seed.  This is relatively easy because you have have multiple versions of Xcode installed without any grief.

          • You could run Xcode, and hence this lab, in a virtual machine (VM).  You may have the same problem there, but it seems unlikely.

          • You could try macOS 10.14 beta.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

          [1] It’s not that this isn’t possible, just that it shouldn’t be possible.

            • Re: Xcode Playgrounds causes full system hang when running labs
              rokamo Level 1 Level 1 (20 points)

              I just bought a new MacBook Pro 15" 16GB memory 256 GB storage machine this afternoon.

              I installed Mojave on it.

              I downloaded the latest developer release of Xcode 10.1 beta 2

              Whenever I drag the Xcode window to move it the Xcode app and all other apps freeze. Only the mouse pointer can be moved.

              The keyboard does not respond. Several times the screen became unreadable as the window I was dragging was redrawn but not erased.

              I just phoned Apple support and they told me to seek help in this forum.


              What I am trying to do now:


              1. Run Xcode 10 release

                   1b. If that doesn't work, I will get a sysdiagnose and file a bug report

              2. If that doesn't work, I'm going to have to try reverting to MacOS High Sierra.

              3. If that doesn't work, get a refund on this brand new MacBook Pro.


              Seems like an OS issue and that somehow Xcode 10.1 beta 2 triggers it. This issue is reproducible.