Clear Space On Mac

June 2021 | Reclaim space from XCode and other folders on your Mac

XCode

Reclaiming space from XCode mainly involves deleting files from ~/Library/Developer/.

Caches

Folders inside ~/Library/Developer/CoreSimulator/Caches/dyld can be deleted safely.

Source: Apple discussions, Stackoverflow

Simulators

Run xcrun simctl delete unavailable to delete old iOS simulators for runtimes which are not supported anymore.

CoreSimulator Logs

Files inside ~/Library/Logs/CoreSimulator can be deleted safely.

Source: Stackoverflow

Archives

Delete archives no longer required from ~/Library/Developer/Xcode/Archives/. Note that you may need certain Archives for debugging purposes. You should not delete these if you want to debug deployed versions of your apps.

Source: Stackoverflow

Derived Data

Files inside ~/Library/Developer/Xcode/Derived Data/ can be deleted safely.

Source: Stackoverflow

iOS Device Logs

Files inside ~/Library/Developer/Xcode/iOS Device Logs can be deleted safely.

Source: Stackoverflow

Brew

Run brew cleanup to remove old versions of installed formulae.

Source: Stackoverflow

node_modules

Run npx npkill to find and delete node_modules/ folders across your computer.

npm

Run npm cache clean --force to clear the ache from ~/.npm/.

Yarn

Run yarn cache clean to delete cache from ~/Library/Caches/Yarn/.

Gradle

Delete files inside ~/.gradle/caches.

Source: Stackoverflow