Skip to content

Instantly share code, notes, and snippets.

@Gerst20051
Forked from Jerrot/clean_xcode.sh
Created June 25, 2016 05:06
Show Gist options
  • Save Gerst20051/0c0a827b82fe8666555dd3bec8a70f72 to your computer and use it in GitHub Desktop.
Save Gerst20051/0c0a827b82fe8666555dd3bec8a70f72 to your computer and use it in GitHub Desktop.
Resets all installed Xcode simulators and deletes the contents of Derived Data
#!/bin/sh
instruments -s devices \
| grep "(\d[.0-9]\+) \[[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}\]" \
| grep -o "[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}" \
| while read -r line ; do
echo "Reseting Simulator with UDID: $line"
xcrun simctl erase $line
done
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment