I would avoid Xcode 14 (seems to have corrupted my system)

A few days ago I used Xcode 14 Beta to gather some build timings for three of my projects. That went well. I then went back to using Xcode 13.4.1, but found that two of those three projects would immediately crash Xcode when I opened them.

Also started to have crashes in other projects when debugging (single clicks into the debugging panel or even trying to resize Xcode windows would crash it).

Deleting Xcode 14 and 13.4.1 and re-installing just 13.4.1 didn't fix the issue. Even after reboots and purging all Derived Data.

I'm now deleting anything developer related (e.g. /Library/Developer), going to reboot, install Xcode 13.4.1 fresh and hope for the best.

Earlier I also tried re-installing 13.4, but the same issues were experienced with that. Actually, after scrubbing my system, I may just go back to Xcode 13.3 and should that prove stable, then perhaps move to 13.4.x. I'm assuming that running Xcode 14 is what hosed my system and that it's not a fault of 13.x which I've used without issue prior.

Answered by InstantInteractive in 716995022

After restoring all project files, things were still messed up. So I completely purged any Developer or Xcode folder found in /System/Library, ~/Library, etc. Then, restored from a backup. Chose June 1st which was back when I had Xcode 13.4. Also re-restored all projects (archiving off any source file changes though).

Re-installed Xcode 13.4.1 and so far things are working as expected. So between messing up my project files, Xcode 14 must have also messed up something in ~/Library, or elsewhere.

And hurray! The hot key Shift Command A in the simulator is once again toggling dark mode. I didn't mention that ealier, but that was another function I had lost. Executing the hot key briefly flashed the Features menu in the Simulator, but the appearance didn't change. Workaround was to go into Preferences | Developer, but that got annoying.

Accepted Answer

After restoring all project files, things were still messed up. So I completely purged any Developer or Xcode folder found in /System/Library, ~/Library, etc. Then, restored from a backup. Chose June 1st which was back when I had Xcode 13.4. Also re-restored all projects (archiving off any source file changes though).

Re-installed Xcode 13.4.1 and so far things are working as expected. So between messing up my project files, Xcode 14 must have also messed up something in ~/Library, or elsewhere.

And hurray! The hot key Shift Command A in the simulator is once again toggling dark mode. I didn't mention that ealier, but that was another function I had lost. Executing the hot key briefly flashed the Features menu in the Simulator, but the appearance didn't change. Workaround was to go into Preferences | Developer, but that got annoying.

Git SCM is usually the way to go by branching your code into maybe an Xcode 14 branch where all work related to Xcode 14 takes place in there and some other branch from develop is where normal Xcode 13 or feature development continues to take place.

This also affected a second computer (MacBook Pro with M1 Max). The first computer was an iMac Pro. Both with macOS 12.4. For the second computer, I didn't experience crashes, but had the same issue with Shift Command A not working in the Simulator. And Xcode's builds seemed to fail more often (could not really identify a root cause).

Anyhow, I was able to delete /System/Developer, then re-install those files by running Xcode.app/Contents/Resources/Packages/XcodeSystemResources.pkg

So this issue appears to be isolated to files that are stored in /System/Developer

Have filed feedback: FB10229268

Also, when I mentioned "/System/Developer", that should have instead been "/System/Library/Developer". That's the folder I deleted and what XcodeSystemResources.pkg recreates.

One thing I think it may be related is some local Xcode files you would normally add to .gitignore. I cloned the project again in a different folder, then it works to open that copy of the project

It wasn't the project in any way though. It turned out that Xcode 14 Beta messed up files in /System/Library/Developer. It destabilized Xcode 13.x such that it would crash or do unexpected behavior.

I had same issue today - Xcode 14 corrupted something and Xcode 13 couldn't open the project.

I tried removing ~/System/Developer as @InstantInteractive suggested, but didn't work for me.

However git cloning in a different folder as @fespinozacast suggest worked. Moving that folder back to original path, also worked fine.

i followed @instantinteractive's suggestion but slightly differently:

  1. deleted /Library/Developer/PrivateFrameworks
  2. installed Xcode.app/Contents/Resources/Packages/XcodeSystemResources.pkg

on my system at least, XcodeSystemResources.pkg creates the /Library/Developer/PrivateFrameworks folder.

anyway that fixed "Toggle Appearance" in the Simulator for me! thanks for the tip!

No change with Xcode 14 Beta 2. Don't know why they cannot put more urgency in fixing this issue.

I'm using Xcode 13.4.1 (13F100) and have been stumped trying to figure out why toggling dark mode via Shift+CMD+A or Features -> Toggle Appearance was not working. Unfortunately, clearing derived data did not work and I had not yet ventured into deleting much more. I did, however, discover that within the Debug Tray toolbar at the bottom of Xcode, there is an Environment Overrides icon that opens a panel. If I toggle the Appearance switch, I'm able to freely switch between light & dark mode in the simulator. However, this setting does not re-enable the hot key or the menu option, but it works! Hope this helps someone else like me who was going insane trying to figure this out

I had the same issue. macOS 12.4, downloaded the first Xcode 14 beta and noticed right away that "toggle appearance" in the simulator no longer works, even when going back to Xcode 13.4. Only option is to trigger manually via Settings > Developer in the simulator.

I tried @bunnyhero 's approach and it worked! Thank you!

take a peek at this twitter thread from an xcode engineer, They seem to be aware of xcode14b3 having big issues with xcode13.4.x and below. Looks like they have a workaround , as they made a back end change for now. but you have to open a certain pane in xcode 14 then you can go back to xcode 13.4.1 etc.

https://twitter.com/AnaCalinov/status/1545118596820439040

Got Beta 3 installed tonight and so far all is going well alongside Xcode 13.4.1.

  • In Xcode 14, the Simulator does respond to Command-Shift-A to toggle light/dark mode.
  • Opened two of my projects, built and ran a-ok.
  • Closed Xcode 14, then launched Xcode 13.4.1 and opened the same projects. No more crashes there.
  • Building and running with Xcode 13.4.1 also had no issues. No crashes when debugging. And the Simulator also responds to Command-Shift-A.

14 is a piece of junk. All kinds of issues, pod files corrupted, not finding pods correctly, errors with no explanations or logs attached. Apple, do you test any of this stuff before you release it? Or, are you adopting the MS method and just figure you will let us find your bugs and then issue hot fixes? If that's the case, I charge 225.00 a hour for debug work.

avoid xcode 14 at least for time being. my iphone 12 pro running ios 16 so download xcode 14 to support to test my app. so many issues. move back to xcode 13.4.1

I would avoid Xcode 14 (seems to have corrupted my system)
 
 
Q