Last active
April 8, 2026 01:52
-
-
Save AndresSepar/bff7f1f1a4ec773023d649c1d3967748 to your computer and use it in GitHub Desktop.
XCODE CLEANUP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "π£ XCODE EXTREME CLEANUP STARTING..." | |
| echo "πͺ Killing processes..." | |
| killall Xcode 2>/dev/null | |
| killall Simulator 2>/dev/null | |
| killall xcodebuild 2>/dev/null | |
| killall com.apple.CoreSimulator.CoreSimulatorService 2>/dev/null | |
| killall CoreDeviceService 2>/dev/null | |
| killall MetalCompilerService 2>/dev/null | |
| killall SourceKitService 2>/dev/null | |
| killall IBDesignablesAgentCocoaTouch 2>/dev/null | |
| echo "π Removing Xcode.app..." | |
| rm -rf /Applications/Xcode.app | |
| echo "π Removing Developer folders..." | |
| rm -rf /Library/Developer | |
| rm -rf /Library/Developer/CommandLineTools | |
| echo "π Removing user developer data..." | |
| rm -rf ~/Library/Developer | |
| rm -rf ~/Library/Developer/Xcode | |
| rm -rf ~/Library/Developer/CoreSimulator | |
| rm -rf ~/Library/Developer/XCPGDevices | |
| echo "π Removing Device Support..." | |
| rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport | |
| rm -rf /Applications/Xcode.app/Contents/Developer/Platforms | |
| echo "π Removing DerivedData..." | |
| rm -rf ~/Library/Developer/Xcode/DerivedData | |
| echo "π Removing Archives..." | |
| rm -rf ~/Library/Developer/Xcode/Archives | |
| echo "π Removing simulators..." | |
| rm -rf ~/Library/Developer/CoreSimulator/Devices | |
| rm -rf ~/Library/Developer/CoreSimulator/Caches | |
| rm -rf ~/Library/Developer/CoreSimulator/Profiles | |
| echo "π Removing CoreSimulator services..." | |
| rm -rf ~/Library/Logs/CoreSimulator | |
| rm -rf ~/Library/Preferences/com.apple.CoreSimulator.plist | |
| echo "π Removing Xcode caches..." | |
| rm -rf ~/Library/Caches/com.apple.dt.Xcode | |
| rm -rf ~/Library/Caches/com.apple.DeveloperTools | |
| rm -rf ~/Library/Caches/com.apple.dt.XcodeInstallCheckCache | |
| echo "π Removing build system caches..." | |
| rm -rf ~/Library/Caches/org.swift.swiftpm | |
| rm -rf ~/Library/org.swift.swiftpm | |
| echo "π Removing SourceKit caches..." | |
| rm -rf ~/Library/Caches/com.apple.SourceKitService | |
| echo "π Removing Metal caches..." | |
| rm -rf ~/Library/Caches/com.apple.metal | |
| rm -rf ~/Library/Caches/com.apple.metalfe | |
| rm -rf ~/Library/Developer/Xcode/Metal | |
| echo "π Removing iOS runtimes..." | |
| rm -rf ~/Library/Developer/CoreSimulator/Profiles/Runtimes | |
| echo "π Removing provisioning caches..." | |
| rm -rf ~/Library/MobileDevice/Provisioning\ Profiles | |
| echo "π Removing device logs..." | |
| rm -rf ~/Library/Logs/DiagnosticReports/Xcode* | |
| rm -rf ~/Library/Logs/DiagnosticReports/CoreSimulator* | |
| echo "π Removing Interface Builder caches..." | |
| rm -rf ~/Library/Caches/com.apple.dt.IB* | |
| echo "π Removing preferences..." | |
| rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist | |
| rm -rf ~/Library/Preferences/com.apple.dt.XcodeBuild.plist | |
| rm -rf ~/Library/Preferences/com.apple.dt.XCBuild.plist | |
| rm -rf ~/Library/Preferences/com.apple.dt.Xcode.LSSharedFileList.plist | |
| echo "π Removing saved states..." | |
| rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState | |
| echo "π Resetting xcode-select..." | |
| xcode-select --reset | |
| echo "π§Ή Flushing caches..." | |
| dscacheutil -flushcache | |
| echo "β‘ EXTREME CLEANUP COMPLETE" | |
| echo "π Restart your Mac before reintall Xcode." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment