Created
January 15, 2010 18:12
-
-
Save hboon/278281 to your computer and use it in GitHub Desktop.
Script to Remove Core Data's SQLite Database File During Development Cycles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Adapted from http://furbo.org/2009/03/03/open-sesame/ | |
if [ -z "$1" ]; then | |
echo "usage: $0 <app> [ Preferences | <document> ]" | |
else | |
app=`ls -1td ~/Library/Application\ Support/iPhone\ Simulator/User/Applications/*/$1.app | head -1` | |
dir=`dirname "$app"` | |
if [ "$2" = "Preferences" ]; then | |
open "$dir/Library/Preferences" | |
else | |
echo $1 | |
rm "$dir/Documents/$2/$1.sqlite" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment