Skip to content

Instantly share code, notes, and snippets.

@AmitGazal
AmitGazal / xcode-cleanup.sh
Created August 25, 2025 06:48
Bash script to free up disk space by cleaning Xcode’s DerivedData, Archives, Device Support, Simulators, and Documentation caches.
#!/bin/bash
echo "Cleaning up Xcode files…"
# Show current heavy folders
du -sh ~/Library/Developer/Xcode/DerivedData \
~/Library/Developer/Xcode/Archives \
~/Library/Developer/Xcode/iOS\ DeviceSupport \
~/Library/Developer/CoreSimulator/Devices \
~/Library/Developer/Xcode/DocumentationCache 2>/dev/null || true