Removing calendar off ipod touch and iPhone hack

It seems a well documented problem that if you sync your iPod Touch or iPhone with your machine. then decide to change to a different calendar, it can be really hard to get rid of the older calendar, especially if like me, you sync with google apps then decide to go with the exchange option.

So now im stick with 2 or three copies of my gmail calendar on my iPhone, which no matter WHAT i try does not go away, even after i tell it to not sync any calendars in iTunes.

Luckily i Jailbreak my iphone, i ssh’d in and found where the calendar files are. This fix im afraid only works with a jail broken iPod/iPhone.

ssh in or open a console. If you have file browser you prefer then by all means use that. You need to grab the file at /private/var/mobile/Library/Calendar/Calendar.sqlitedb .

You can use scp to do this, find the IP of the device, then

an7:Desktop wishes$ scp root@10.40.1.5:/private/var/mobile/Library/Calendar/Calendar.sqlitedb .
root@10.40.1.5’s password:
Calendar.sqlitedb                                                                                                                 100%  636KB 636.0KB/s   00:01

Once you have the file, you need an SQLite browser to edit it. I used http://sourceforge.net/projects/sqlitebrowser/ on my mac. Make a backup of the sql file before editing it. Open it in the sqlite browser. Click ‘Browse Data’ then in the drop down look at Calendar. Find the entry you dont want, delete it, then save the database again.

Copy it back to the device.

lan7:Desktop wishes$ scp Calendar.sqlitedb root@10.40.1.5:/private/var/mobile/Library/Calendar/Calendar.sqlitedb
root@10.40.1.5’s password:
Calendar.sqlitedb                                                                                                                 100%  524KB 524.0KB/s   00:00

Then test it. If it worked then presto! if not you still have that backup right?.