Does anyone else get this, like every 5 minutes when working with SwiftUI previews in Xcode 16? It's maddening…

#xcode16

@matt1corey https://iosdev.space/@slow_brewed/113105967990199465

And

https://iosdev.space/@slow_brewed/113109760612404573

I do have to say in the now stable release of Xcode 16, it’s gotten better. I still get crashes at least once an hour. But it is way more tolerable.

sbm :xcode: (@[email protected])

I have some serious concerns about the last or latest Xcode beta Previews still crashing every 5 mins so late in the game. The solution to getting it to work again is a full reboot of Xcode. I hope they get this fixed before the full release this week. #xcode16 #iOSDev #SwiftDevCommunity #SwiftDev

iOS Dev Space

@slow_brewed Oh, look at that, there was a new Xcode released yesterday. That's slightly embarrassing :)

Let's see if this does any better

@matt1corey well... TBH, You might still get some crashes but it should be significantly better. I'm trying the step to at least disable the crash reporter pop up. But man, Previews is something you'd think they'd 100% get right before shipping... 😕
@slow_brewed 2 crashes tonight 😭

@matt1corey @jandamm I've enabled this recently and it has helped quite a bit. Might help in your case too in really reducing the frequency of the crashes. I only noticed it recently. There is a possibility that there is a new execution environment for Previews that's still quite in beta mode.

#xcode #xcode16 #swiftui

@matt1corey @jandamm Did some more digging. This issue could be due to in-place Xcode upgrades through beta versions. Each instance is separate, but caches, files, and binaries may still be shared after an older version is removed.

I’ve now done a full absolute cleanup/removal of Xcode + junk stuff, rebooted, and am reinstalling v16.0 from scratch (including simulators). I’ll test it through Sunday and report. Hopefully, this fixes it—TBD.

#Xcode16 #SwiftDevCommunity #SwiftUI #SwiftLang

@slow_brewed @jandamm that wouldn’t surprise me - what did you delete, exactly? There’s so much stuff stored in multiple places that I’ve had to delete to clear up disk space, but I’m sure I didn’t get it all

@matt1corey @jandamm

1 - I used DevCleaner to remove all simulators and DerivedData (https://github.com/vashpan/xcode-dev-cleaner).

2 - I followed that up with some of the stuff from here: https://byby.dev/uninstall-xcode

3 - I used PearCleaner (my favorite uninstaller) to do a full delete of all versions of Xcode I've got stored: https://github.com/alienator88/Pearcleaner

Fair warning though, because this is as much of a clean up as you can do, you might lose some preferences and might have to set those up again.

Extensions do remain.

GitHub - vashpan/xcode-dev-cleaner: If you want to reclaim tens of gigabytes of your storage used for various Xcode caches - this tool is for you!

If you want to reclaim tens of gigabytes of your storage used for various Xcode caches - this tool is for you! - vashpan/xcode-dev-cleaner

GitHub

@slow_brewed @jandamm Welp, after taking these steps, I had a crash within 5 minutes 😠

I didn't do a full uninstall/reinstall, so that's the next step, I guess

@matt1corey @slow_brewed haven't used it before but you might be able to restore your settings with https://github.com/lra/mackup.
Ideally the settings of Xcode shouldn't affect the crashes 😅
GitHub - lra/mackup: Backup and keep your application settings in sync.

Backup and keep your application settings in sync. - lra/mackup

GitHub

@matt1corey @jandamm OK, last one... I know, I keep chasing this. But hear me out:

during the betas and even after going with the stable versions, until the full cleanup I mentioned earlier, I could no longer get Xcode Previews to work on a physical device.

The cleanup resolved that too.

@matt1corey @slow_brewed I recently discovered ~/Library/Developer/Xcode is close to 200GB on my machine 😤
@jandamm @matt1corey @slow_brewed I found that with Daisy Disk and almost choked when I saw it.
@MuseumShuffle @matt1corey @slow_brewed I used Daisy Disk as well.
So good to quickly check where your drive filled.
@jandamm @MuseumShuffle @slow_brewed yeah, Daisy Disk is my go to as well - the problem I have is that there’s stuff scattered in many places, so having some guidance is necessary
@jandamm @MuseumShuffle @matt1corey Indeed. I used Daisy Disk too. Helped me chase anything that was unusually large (turned out to usually be Xcode artifacts) and confirm it was deleted after I proceeded with the cleanup. It was one of the reasons I rebooted. Even when files are removed from the system, MacOs dissent always free up the space right away.

@matt1corey @jandamm @MuseumShuffle So it's early results. But I worked a few hrs last night into early Sunday and it's been fantastic. Quick reloads (no longer sluggish), zero crashes. 👀

That's on two relatively large projects opened simultaneously, multiple Previews macros for different UI checks in some Views.

Env: base MBP M1 with16 GB RAM, Sequoia 15.1 Beta 3, Xcode 16.0, iOS 18.0 sims, watchOS 11.0 sims.

Based on this, I guess we can say we're probably good with the cleanup solution.