How to clean junk files in Xcode from iOS support

Viewed 6075

I have tried cleaning the simulator but it again occupies 6gb disk space on my Mac. Can anyone suggest manual cleaning?

4 Answers

If the objective is to free up disk space occupied by Xcode-related and simulator-related caches and data, and not just iOS support files, there are other folders you can look into to consider removing files, besides ~/Library/Developer/Xcode/iOS DeviceSupport/ and ~/Library/Developer/Xcode/DerivedData that have been mentioned in the other 2 answers so far.

  • ~/Library/Developer/Xcode/Archives/ contains data from your builds that can be helpful in the process of symbolicating/debugging deployed apps, but could otherwise be removed. Thankfully, it is organized by date, so you can choose to keep specific folders inside it, and delete the rest
  • ~/Library/Developer/CoreSimulator/ contains simulator related data. It includes a Caches folder and a Devices folder. If you no longer need to run your apps on certain devices, you may consider removing those devices' corresponding folders in the Devices folder. The Caches folder may grow over time as well, and you can remove contents from there, and they should be regenerated as needed.
  • If you've been using this machine for some years, it may be worth looking for ~/Library/Application Support/iPhone Simulator. The simulator related files used to be there until around Xcode 6. So you may have files still there that you might want to delete (I did, on some older Macs some years back)
  • There's an Xcode specific cache (not about simulators), ~/Library/Caches/com.apple.dt.Xcode, which should be regenerated as needed, but may be less useful to clean up.

You could also consider running DevCleaner from time to time to remove unnecessary Xcode-related files.

  • Delete the contents of "~/Library/Developer/Xcode/iOS DeviceSupport/".
  • Remove all "paired devices" in iOS settings > Developer.
  • Connect iPhone to the Mac and pick "Don't trust".

Since the above is not okay for iTunes syncing etc, try the following:

Delete the contents of the folder "~/Library/Developer/Xcode/iOS DeviceSupport/" and then right click > get info > lock the folder.

Locking the folder will stop Xcode from copying the simulator files from the iPhone to that folder next time you connect them.


It is possible that Xcode starts downloading it via nsurlsessiod so you can block it either

Command-Option-Shift-K to clean out the build folder. Even better, quit Xcode and clean out ~/Library/Developer/Xcode/DerivedData manually. Remove all its contents because there's a bug where Xcode will run an old version of your project that's in there somewhere By following this steps you can do....

For user who are not able to find library/developer path.

open Xcode( i am using Xcode 13) -> file -> workspace setting -> there will be a path at center of modal -> click on arrow button next to path -> on clicking it will open up the folder.

Related