Skip to content

Instantly share code, notes, and snippets.

@hboon
Created January 15, 2010 18:12
Show Gist options
  • Save hboon/278281 to your computer and use it in GitHub Desktop.
Save hboon/278281 to your computer and use it in GitHub Desktop.
Script to Remove Core Data's SQLite Database File During Development Cycles
#!/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