xcode 我在哪里可以找到我的 mac 中的 sqlite3 数据库文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9902330/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 23:48:11  来源:igfitidea点击:

Where can I find my sqlite3 database file in my mac?

databasexcodefilesqlite

提问by nOOb iOS

I created a sqlite3 database using terminal which has a static data. I need to add that db file into my xcode project to retrive data from it. But, I couldnt find the db file in my mac to add into my project. Where can I find my db file, so that I can add it into my Xcode. Thanks in advance :)

我使用具有静态数据的终端创建了一个 sqlite3 数据库。我需要将该 db 文件添加到我的 xcode 项目中以从中检索数据。但是,我无法在我的 mac 中找到要添加到我的项目中的 db 文件。我在哪里可以找到我的 db 文件,以便我可以将它添加到我的 Xcode 中。提前致谢 :)

回答by Hans Kruse

My sqlite database is located here: Library/Application Support/iPhone Simulator/skd version(i.e. 5.1)/Applications/a bunch of numbers and letters/Documents/yourdatabase

我的sqlite数据库位于:Library/Application Support/iPhone Simulator/skd version(ie 5.1)/Applications/一堆数字和字母/Documents/yourdatabase

回答by Andrew Owen Ssembatya

  • ->Go to your Desktop(i.e click on the desktop)
  • ->press (shift)+(cmd)+(G) a search tab should open up
  • ->in the search tab enter this url "~/Library/Developer/CoreSimulator/Devices/"

  • -> find the latest device by the date modified and go further in the file explorer to /data/Containers/Data/Application/(APPLICATION_ID)/Documents/(databaseName).sqlite

  • ->转到您的桌面(即单击桌面)
  • ->按 (shift)+(cmd)+(G) 应该会打开一个搜索选项卡
  • -> 在搜索选项卡中输入此网址“~/Library/Developer/CoreSimulator/Devices/”

  • -> 按修改日期查找最新设备,然后在文件资源管理器中进一步访问 /data/Containers/Data/Application/(APPLICATION_ID)/Documents/(databaseName).sqlite

回答by Aleks

Maybe you could look at this thread, but I'm not sure that is what you want : here

也许你可以看看这个线程,但我不确定那是你想要的:这里

回答by Nikolay

Finding the default directory path:

查找默认目录路径:

Open terminal.

打开终端。

Open your database trough the command line then type '.databases', the command outputs the path of your database file right next to 'main'.

通过命令行打开您的数据库,然后键入“.databases”,该命令会在“main”旁边输出数据库文件的路径。

In my case the command sequence was:

在我的情况下,命令序列是:

sqlite3 myDBFile.sqlite

sqlite3 myDBFile.sqlite

sqlite3> .databases

sqlite3> .databases

Output: 0 main /Users/Me/myDBFile.sqlite

输出:0 主 /Users/Me/myDBFile.sqlite