I\'m developing an iPhone app that uses the built-in SQLite database. I\'m trying to view and open the database via the sqlite3 command line tool so I can execute a
This one works if you jailbreak your iPhone.. I don't know why anyone would have any issues with jailbreaking their phone as I've been using it for development for quite some time and found no problems, also it is not uncommon for sqlite to perform differently on the device vs simulator:
which sqlite3 to ensure you have it installedbrowse to the location of your db.. a breakpoint in your code should tell you where it is located.. in my code it looks something like this
NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex: 0];
NSString *pathName = [documentsDirectory stringByAppendingPathComponent:filename];
return pathName;
Notice that if you run this on the simulator.. you'll get a location like the following:
/Users/admin/Library/Application Support/iPhone Simulator/6.0/Applications/42302574-7722-48C1-BE00-91800443DA7C/Documents/email-524200.edb
On the device it will look like this:
/var/mobile/Applications/FB73857F-A822-497D-A4B8-FBFB269A8699/Documents/email-523600.edb
Then just type sqlite3 %dbname% and you can execute sql statements right on your phone.. without copying it over or whatever.