Script to Remove Core Data's SQLite Database File During Development Cycles

Hi, I'm Hwee-Boon Yar

I write, ship and sell software products. iOS/OS X app developer based in Singapore, working remotely. This is my blog.


Need to run a code review on your codebase? Hire me

During development of applications that uses Core Data on the iPhone, I find myself often wanting to delete the SQLite database file. This is especially common in the earlier stage where the schema isn't finalized yet. Here's a script that helps with that, building on Craig Hockenberry's Open sesame script.


Save the script as clearcoredata, make it executable. To delete the SQLite database file, run: clearcoredata <app name>.

Like this post? Follow me @hboon on Twitter.