Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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