If system is slow or you are running out of space and you aren't able to install necessary items due to insufficient space then please refer below steps and delete unnecessary items:


  1. Open Finder.
  2. Tap Go > Go To Folder...
  3. Enter each Path from below guide to clear respective data, and click OK to open the folder. (as explained through What the folder contains)
  4. Now from specific folder, you can delete unnecessary files carefully.


Path

What the folder contains / can be deleted

~/Library/Developer/Xcode/DerivedData

Delete this folder after every few days interval. Most of the time, it occupy huge space

~/Library/Developer/Xcode/Archives

Before you decide to delete, if you want to be able to debug deployed versions of your App, don't delete the specific archive, just delete old archives.

~/Library/Developer/Xcode/iOS Device support 

Keep the latest version, and older versions only which are required, and rest of them can be deleted

~/Library/Developer/CoreSimulator

App data is stored here. can delete all except required data.

~/Library/Caches/com.apple.dt.Xcode

It will be recreated as necessary. So can delete.