Skip to content

Instantly share code, notes, and snippets.

@brackendev
Last active January 6, 2020 20:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brackendev/8327852e21ce5b7f480f72459faa277a to your computer and use it in GitHub Desktop.
Save brackendev/8327852e21ce5b7f480f72459faa277a to your computer and use it in GitHub Desktop.
[Shell] Deep clean Xcode project
#!/bin/sh
# Deep clean Xcode project. Run from project root directory.
if [ -d "build" ]; then
/bin/rm -rf "build"
fi
if [ -d "$HOME/Library/Developer/Xcode/DerivedData" ]; then
/bin/rm -rf "$HOME/Library/Developer/Xcode/DerivedData/*"
fi
if [ -x "$(command -v xcodebuild)" ]; then
/usr/bin/xcodebuild -configuration "Debug" clean
/usr/bin/xcodebuild -configuration "Release" clean
fi
/usr/local/bin/pod deintegrate
if [ -f "Podfile.lock" ]; then
/bin/rm -f Podfile.lock
fi
if [ -x "$(command -v pod)" ]; then
/usr/local/bin/pod cache clean --all
/usr/local/bin/pod repo update
/usr/local/bin/pod install
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment