【问题标题】:How to add files to the /Document folder in the iPhone Simulator for testing如何将文件添加到 iPhone 模拟器中的 /Document 文件夹进行测试
【发布时间】:2014-08-06 23:53:07
【问题描述】:

我正在编写一个适用于文档的应用程序。在真正的 iPhone 上,我可以使用 iTunes 在应用程序的 Documents 文件夹中添加文档。但是为了测试,我需要在模拟器中我的应用程序的 Documents 文件夹中加载一些文件。我该怎么做?

【问题讨论】:

    标签: location ios-simulator directory document


    【解决方案1】:

    呃。都是我自己发现的。它隐藏得很好。至少在模拟器中运行您的应用程序一次。然后将它们放在以下文件夹中(假设您在此示例中使用的是 5.1 iOS 目标):

    /Users/your_user_name/Library/Application Support/iPhone Simulator/5.1/Applications/some_alphanum_code_representing_your_app/Documents

    我在发现此问题之前使用的解决方法是将文档文件添加到 XCode 项目中,这会将它们复制到主包中。然后我以编程方式将它们从主包路径复制到 /Document 路径。

    【讨论】:

      猜你喜欢
      • 2011-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-13
      • 1970-01-01
      • 2017-02-13
      • 2012-06-29
      • 2014-12-03
      相关资源
      最近更新 更多