有人可以告诉我 XCode 到 iPhone 的路径吗?

发布于 2024-09-09 02:58:12 字数 145 浏览 2 评论 0原文

我正在预填充 sql 文件,并且想知道 Xcode 在哪里保存设备应用程序的文件夹。例如,在模拟器上获取应用程序的文件夹是/username/library/application support/simulator。有人可以告诉我设备的这些文件夹在哪里吗?任何帮助表示赞赏。

Im in the process of pre populating a sql file and would like to know where Xcode keeps its folders for apps for the device. For example, the folders to get the apps on the simulator is /username/library/application support/simulator. Can someone please tell me where these folders are for the device? Any help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

江湖正好 2024-09-16 02:58:12

它位于发布项目文件夹内的构建文件夹中。所以projectFolder/build/appName.build/release。最后实际文件夹的名称可能会根据目标和其他情况而改变。

但是,如果您有将文件直接放入构建中的想法,那就忘记它吧。只有由正确签名的编译器放入应用程序包中的项目才能工作。代码签名机制不允许您在编译后添加任何内容。

相反,请将 SQL 文件添加到项目本身并将其添加到发布目标。当您构建版本时,SQL 文件将包含在应用程序包中。我经常这样做。

It's in the build folder inside the project folder under release. So projectFolder/build/appName.build/release. The name of the actual folder on the end may change depending on targets and what not.

However, if you have some idea of putting a file directly into to the build forget it. Only items put inside the app bundle by the properly signed compiler will work. The code signing mechanism will not allow you to add anything post compile.

Instead, add the SQL file to the project itself and add it to the release target. When you build the release, the SQL file will be included inside the app bundle. I do this rather a lot.

诗笺 2024-09-16 02:58:12

使用 CoreData 加 SQLite,我看到 sqlite 存储文件被放入 iPhoneSimulator 中我的应用程序的 /Documents 目录中,如果您想精确获取该路径,可以使用此方法:

NSString * documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) 
                                 objectAtIndex:0];

Using CoreData plus SQLite i see that the sqlite store file is put into the /Documents directory of my App in the iPhoneSimulator, if you want to get that path precisely you can use this method:

NSString * documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) 
                                 objectAtIndex:0];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文