I hosed Xcode's Platforms list, what now?

In a feat of unmitigated disk cleaning, I removed who-knows-what, likely from ~/Library/Developer. Now I can't build apps that rely on watchOS (or likely tvOS/visionOS from the look of things). Run a try to build, Xcode tells me I should download watchOS, immediately shows me that it has, then does nothing. My Platforms window looks like this. If I tap Get next to watchOS 10.2 it looks like it succeeds immediately, but doesn't work (notice that 10.2 is already in the list). If I try to delete 10.2 from this list, it gives me an error that it can't find it on disk to delete it.

I'm guessing there's a mismatch between some preference file and reality.

Totally my fault I'm certain. Best way to recover?

Answered by mitchcohen in 786891022

When all else fails, reboot. When that fails, reboot the next morning. After the morning reboot the "installed" simulators were all gone from the list and I was able to reinstall them. All good now.

Delete all the platforms that you're trying to get. In other words, right-click the "visionOS 1.0 Simulator" at the bottom of the list, choose "Delete..." You should then be able to click "Get" on the "visionOS 1.0" item that's greyed-out.

Repeat this for everything, and you should be up and running.

FYI, don't ever unmount them in Disk Utility either, as that causes them to be unavailable, too.

This is what I get when attempting to delete any Simulator. This happens to be watchOS 10.2, but I tried with the other watchOS versions, VisionOS, and others.

Accepted Answer

When all else fails, reboot. When that fails, reboot the next morning. After the morning reboot the "installed" simulators were all gone from the list and I was able to reinstall them. All good now.

Totally my fault I'm certain.

Are you sure it wasn't this: https://developer.apple.com/forums/thread/751049 ?

I hosed Xcode's Platforms list, what now?
 
 
Q