Failing to permanently delete old simulator volumes

Hello all,

Yesterday, I found out that there's 60GB's of old simulator volumes on my mac in /Library/Developer/CoreSimulator/Volumes/. When I try to delete those through Xcode Settings -> Components under Other Installed Platforms, it looks like they are deleted, but after restarting my Mac, they simply return.

I tried the solution proposed here (which is to delete the dmg files in /Library/Developer/CoreSimulator/Images/), but in my case, there are no dmg files in there. So it looks like they were properly deleted, unlike those in /Library/Developer/CoreSimulator/Volumes/.

I could obviously try to delete the dmg files in /Library/Developer/CoreSimulator/Volumes/, but that doesn't work according to a post on reddit that I'm not allowed to show here (It's called 'Deleted 240GB of Xcode simulators multiple times but they keep remounting - how do I permanently remove them?') And I wonder if it's a safe thing to do.

Do you have any suggestions for how to remove the old volumes correctly and permanently?

Open terminal and check:

To list unavailable simulators: xcrun simctl list devices unavailable

To delete them: xcrun simctl delete unavailable

Thank you for your reaction, lionel.

'xcrun simctl list devices unavailable' correctly lists the unavailable devices. However, as shown on the screenshot below, 'sudo xcrun simctl delete unavailable' does not delete them, since they are still there when I run 'xcrun simctl list devices unavailable' afterwards.

I decided to run the delete command with the --verbose flag. You can see the result below. There aren't any errors, but I noticed that at the 10th line or so it says 'PATH = /opt/homebrew/...'

Does anyone know if homebrew could be the cause or have any other suggestions as to how I could solve this?

What if you run the delete command without sudo? If simulators are per-user, I'd imagine that'd be a problem since root probably does not own the simulators you are looking at.

Update: after uninstalling homebrew

Deletion of old simulator volumes through Xcode

After uninstalling homebrew (with their uninstall script), deletion through Xcode Settings -> Components under Other Installed Platforms still causes the volumes to return after reboot.

Deletion of old simulator volumes through xcrun

Also, the 'sudo xcrun simctl delete unavailable' still doesn't work (no error, but doesn't delete the volumes), and it still throws a permissions error when I run it without sudo. Without sudo, it says: “data” couldn’t be moved because you don’t have permission to access “Deleting-EFB3F8B5-7367-42AC-869B-CD35C464E635”. I tried changing permissions of that file, but I can't find it in finder. So I guess it is a temporary file. It's weird though, because the command is supposed to work without sudo, right?

Does anyone have a clue as to what I could try next?

Use this: xcrun simctl delete unavailable

Without sudo. I have been using that to clear previous versions of simulators that have been orphaned.

Hello lionel, That doesn’t work on my mac for some reason, which you could have known since I’ve mentioned that twice. Please read my previous reply and my comment on ktchew’s reply for more information.

Maybe try reinstalling the simulator to force Xcode to re-register the runtime correctly. Then remove the component.

Thanks again for your reply, lionel. I tried reinstalling the simulators and then removing them again, but still the problem returned.

Then I decided that the only option I had was to completely reinstall Xcode. So I closed Xcode, killed all xcode/simulator processes I could find, deleted ~/Library/Developer and some other files, deleted the Xcode app, downloaded it again from the app store, restarted my mac and even that didn't solve the problem.

Does anyone know where Xcode stores the files that contain information about what iOS-simulator volumes are mounted on startup? Maybe changing that file would help...

Failing to permanently delete old simulator volumes
 
 
Q