Skip to content

Instantly share code, notes, and snippets.

@brunogama
Last active January 17, 2023 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunogama/dd61460cde4da5cd4dc79c94997a87b1 to your computer and use it in GitHub Desktop.
Save brunogama/dd61460cde4da5cd4dc79c94997a87b1 to your computer and use it in GitHub Desktop.
XCInstall cleaner
#!/bin/bash
FIRST_APP_ON_XC_INSTALL=$(find ~/Library/Developer/Xcode/DerivedData \
-path "*/Build/Products/*/.XCInstall/*.app" \
-type d \
-maxdepth 6 \
-print \
-quit \
-exec dirname {} \;)
CLEAN=${FIRST_APP_ON_XC_INSTALL%/*}
DU_RESULT=$(du -sh "$CLEAN" | cut -f 1)
echo "Deleting $CLEAN"
rm -rf "$CLEAN"
echo "Released .XCInstall $DU_RESULT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment