55

I updated to the latest AppStore release of Xcode (12.3, 12C33). It worked fine for an hour or two. After that it started to constantly freeze after being open for a few seconds to minutes.

I've tried the following, all without success so far:

  • restart macOS
  • clear derived data
  • tried with different projects
  • updating to latest macOS 11

Any other ideas or suggestions how to fix this?


Update

I can confirm that this is fixed in Xcode 12.5

benrudhart
  • 1,406
  • 2
  • 13
  • 25

12 Answers12

72

I found an answer by Darr on the question "Xcode freezes after upgrade to 12.3" on Apple's developer forums that worked for me:

Unpairing my device connected via network and using only lightning cable seems to have resolved the issue for me.

Xcode > Window > Devices and Simulators > device > Connect via network

pkamb
  • 33,281
  • 23
  • 160
  • 191
wikk
  • 734
  • 5
  • 4
  • 1
    Oddly enough this seems to have worked for me too – Christian Gossain Jan 11 '21 at 23:37
  • Important thing is that I was not able to open Devices and Simulators because Xcode took a cup of coffee or two, three... I had to switch off my iPhone and then Xcode became reactive again... – Sal Jan 14 '21 at 17:05
  • 6
    Thanks. I am wondering if Apple employees use xcode, how could they have no issues at all... – zs2020 Jan 25 '21 at 07:30
  • After this, i reboot my device. it works fine – xiao333ma Mar 04 '21 at 08:36
  • If Xcode freezes before you are able to unpair device. Turn off Wi-Fi before doing this. This helped in my case. Thanks! – nickinade Apr 01 '21 at 09:48
  • For me this worked after the update to Big Sur, was still on Catalina before and this trick didn't fix it there... again another couple of hours gone for XCode trouble. – Darkglow Jun 14 '21 at 21:24
27

After going mad, I fixed this by removing all devices from Devices and Simulators (I had connect via network activated).

For now, it's working fine.

Andrei Matei
  • 1,049
  • 2
  • 10
  • 23
11

Power off your Apple Watch

Xcode may hang if the host Mac is connected to an iOS device which has one or more companion watches. The hangs occur when the watches aren't fully prepared for development, or if they are experiencing poor wireless connectivity. (72490921) (FB8945320)

Workaround: Power off the watches, or unpair them from the iPhone.

Xcode 12.4 Release Notes

You can force Xcode to freshly prepare a watch for development using these steps:

  1. Force-quit Xcode.

  2. Power-off and disconnect all iOS device from the Mac.

  3. Reboot the Mac.

  4. Launch Xcode, close all projects, and open the Devices and Simulators window.

  5. Power-on and unlock an iOS device and its companion watchOS devices by entering the passcode as required.

  6. Plug the iOS device into the Mac using USB cable.

  7. Check each iOS device and each watch for any pairing request and approve the requests.

  8. Monitor the status of device preparation in the Devices and Simulators window. If Xcode presents device-preparation errors, follow the guidance in the error message to resolve the error.

Once Xcode finishes preparing the iOS device and its companion watches for development, repeat steps 5 through 8 for each remaining iOS device and its companion watches until you verify that Xcode has prepared all devices for development. You may now open your Xcode projects and resume development.

pkamb
  • 33,281
  • 23
  • 160
  • 191
hstdt
  • 5,652
  • 2
  • 34
  • 34
  • This was it for me. With Apple Watch on, Xcode 12.4 building for device causes beachballs and crashes. Turn watch off and it runs fine on device. – pkamb Feb 23 '21 at 06:16
  • This seems to work for like an hour and that it starts all over again. Grr. – John Scalo Feb 26 '21 at 20:56
8

I've been having the same problem. I had an iOS device connected via USB, unplugged it and it un-froze. Then I continued to have issue requiring force close each time.

I then clear derived data and things have been fine. I opened a StickerPack project and also had the same issue. Clearing DerivedData also fixed it.

Clear Derived Data:

  1. Xcode pulldown menu > Preferences > Locations tab
  2. Click the little arrow next to the path under Derived Data.
  3. Delete the entire folder for you project. It will look like "MyAppName-bwonddotztrgkkfexrjxoncvmjit"

See this explanation about whether it's safe to delete DerivedData for your project.

KevinS
  • 598
  • 4
  • 18
2

I had the same problem with appstore version and someone advised to install from site, now it works fine. https://developer.apple.com/download/more/

zhussupali
  • 44
  • 3
  • I always install from there, and I still encountered this issue with two separate projects. I found deleting the Derived Data finally fixed it for me. I posted another Answer with instructions. – KevinS Dec 16 '20 at 18:37
1

Xcode 12.3 is unstable and many times it crashes.

I reverted back to Xcode 12 and copied disk image of 14.3 in Device Support folder of Xcode (Contents > Developer > Platforms > iPhoneOS.platforms-DeviceSupport).

This I needed to debug on iPhone device having version iOS 14.3 https://github.com/mspvirajpatel/Xcode_Developer_Disk_Images/releases

pkamb
  • 33,281
  • 23
  • 160
  • 191
Manish Nahar
  • 834
  • 10
  • 24
1

Disable WLAN on my iMac fixes the problem currently. Hope they will releast a fix very soon.

Skyborg
  • 854
  • 13
  • 13
0

I recently had similar situation. My Xcode 12.3 project could not be opened. I tried to open directly from popup that appears on start of the Xcode.

What worked for my was to downgrade Xcode to 12.2 and launch Xcode on new project. And then click my old one.

Maybe it would work without downgrading but I didn't check.

0

I had this problem too. I fixed it by going Devices and Simulators in the Windows file and disconnecting the iPhone reference I had for my phone when testing and app. Since the phone was no longer connected, its presence seemed to create a freeze.

0

In my case XCode 12.5 hangs/freezes on startup more or less instantly, right after it opens kind of an empty workspace. I removed everything that I could imagine that deals with XCode on my machine, but it didn't help.

At the end I just used the hotkey for "Close Workspace" - Ctrl+Alt+Cmd+W

I hit this combo very often, very fast right after opening XCode and it worked!

The strange empty workspace showed up and closed instantly - now I could select other projects and everything works again.

m00cfe81
  • 91
  • 1
  • 5
0

There could be the multiple reasons and in my case reason was source control

preferences > Source Control > uncheck Enable source control

enter image description here

Alok
  • 24,880
  • 6
  • 40
  • 67
-3

I have these performance problems with the newly updated Xcode from the AppStore to 12C33 (Xcode frozen for many seconds, instability of interface builder, etc.) only with apps which have frameworks added with cocoa pods and when working in the xcworkspace-file. (Integration of frameworks with Catharge even fail with error message 65). I'm running Xcode under macOS Catalina. Don't know what the technical reason could be, hence would appreciate if someone has an idea on this how to fix it.

Update: In the meantime I could fix it: I eliminated my own devices from the device list and did then a deintegration and a new install of the cocoa pods for the projects. Afterwards I setup my devices again in the device list and all worked well again. Only eliminating and reintegration of my devices as described above didn't work in my case.

Community
  • 1
  • 1
carlson
  • 89
  • 11