简体   繁体   English

iPhone应用程序,Mac上的“文档”目录

[英]iPhone application, Documents directory on Mac

I'm reading through some of the documentation about File Management on iOS. 我正在阅读有关iOS上文件管理的一些文档。 When you create an application for the simulator, does the application get created somewhere on my hard drive? 当您为模拟器创建应用程序时,该应用程序是否在我的硬盘驱动器上的某个位置创建? If so, where is it? 如果是这样,它在哪里?

Also, does this have access to the Documents directory? 另外,这是否可以访问Documents目录? Like if I create some test .txt file, and want to see it in the App->Documents folder, is that possible? 就像我创建一些测试.txt文件并希望在App-> Documents文件夹中看到它一样,这可能吗? Thanks. 谢谢。

Yes. 是。 Look here: 看这里:

~/Library/Application Support/iPhone Simulator/4.3.2/Applications 〜/图书馆/应用程序支持/ iPhone Simulator / 4.3.2 /应用程序

Change the 4.3.2 to be the version of the Simulator you are using. 将4.3.2更改为您正在使用的模拟器的版本。

Within that folder you will find your apps, except the they are named cryptically. 在该文件夹中,您可以找到您的应用程序,但它们的名称是不明确的。 Open one of those folders and you will find your app, named as you recognize it, and the Documents, Library and tmp folders. 打开这些文件夹之一,您将找到自己的应用(以识别方式命名)以及Documents,Library和tmp文件夹。 Documents is where you find the docs that your app creates and uses. 在文档中,您可以找到应用程序创建和使用的文档。 You can, in fact, makes changes to the files in the Documents folder or just access their content to see what your app sees or writes. 实际上,您可以对Documents文件夹中的文件进行更改,也可以只访问其内容以查看您的应用看到或写入的内容。

Under XCode 6, the document directory for your app is quite hidden: 在XCode 6下,您的应用程序的文档目录非常隐藏:

~/Library/Developer/CoreSimulator/Devices//data/Containers/Data/Application// 〜/库/开发人员/ CoreSimulator /设备//数据/容器/数据/应用程序//

You can find the directory for your app with this command: 您可以使用以下命令找到应用程序的目录:

$ sudo find ~/Library/Developer/CoreSimulator/Devices -name <APP_NAME>.app | grep -o '.*/'

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

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