Borut Tomazin
Borut Tomazin

Reputation: 8138

How to log CoreData SQL queries?

I was wondering if there is an option to log SQL queries in CoreData?

Upvotes: 9

Views: 2998

Answers (2)

Borut Tomazin
Borut Tomazin

Reputation: 8138

I also found out that you can also get sql file out of your Documents folder. Open Terminal and paste this line in (replace values in slash-brackets with yours):

/Users/<YourUsername>/Library/Application Support/iPhone Simulator/<SimulatorVersion>/Applications/<AppID>/Documents/<SQLDBName>.sqlite

Just open file in your favorite SQL query browser.

Upvotes: 0

user207128
user207128

Reputation:

Yep, you may do that by putting -com.apple.CoreData.SQLDebug 1 to "Arguments Passed On Launch"

Upvotes: 24

Related Questions