Skip to content

Instantly share code, notes, and snippets.

@Jerrot
Created October 23, 2015 10:08
Show Gist options
  • Save Jerrot/1bc08d23d55a6521af86 to your computer and use it in GitHub Desktop.
Save Jerrot/1bc08d23d55a6521af86 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