Skip to content

Instantly share code, notes, and snippets.

@maciekish
Created August 10, 2016 10:13
Show Gist options
  • Save maciekish/66b6deaa7bc979d0a16c50784e16d697 to your computer and use it in GitHub Desktop.
Save maciekish/66b6deaa7bc979d0a16c50784e16d697 to your computer and use it in GitHub Desktop.
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app
@stefansidler1993
Copy link

you are a GENIUS !! dammmmm

@arthurdapaz
Copy link

I created a shell script (tested on bash or zsh) to do this inside any Xcode workspace or project folder.
Check its gist's here.

@Pierre46
Copy link

Life saver!

@DavidBemerguy
Copy link

Great gist!

@MiklinMA
Copy link

MiklinMA commented Mar 6, 2024

Please welcome my Apple script which works just from spotlight (⌘+Space)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment