简体   繁体   English

如何记录CoreData SQL查询?

[英]How to log CoreData SQL queries?

我想知道是否有在CoreData中记录SQL查询的选项?

是的,你可以通过将-com.apple.CoreData.SQLDebug 1放到“启动时传递的参数”来做到这一点

I also found out that you can also get sql file out of your Documents folder. 我还发现你也可以从你的Documents文件夹中获取sql文件。 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. 只需在您喜欢的SQL查询浏览器中打开文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM