简体   繁体   English

iPhone XCode-将资源从模拟器复制到设备

[英]iPhone XCode - Copy resources from simulator to device

my goal is to copy all .plist files from the Documents directory on simulator ( I create and store some .plist from my simulator ) and the copy this .plist into my resources files when running on the device! 我的目标是从模拟器上的Documents目录复制所有.plist文件(我从模拟器创建并存储一些.plist),然后在设备上运行时将此.plist复制到我的资源文件中! This because I create a game levels on simulator (using mouse is more simple) and when running on device want automatically load this .plist files into iPhone. 这是因为我在模拟器上创建了游戏关卡(使用鼠标更简单),并且在设备上运行时希望自动将此.plist文件加载到iPhone中。

A thing like cp /Users/username/Library/Application Support/iPhone Simulator/5.1/Applications/B5A52177-D17C-4479-AB72-01298392983/Documents/*.plist myResourcesFile on device 类似于cp /Users/username/Library/Application Support/iPhone Simulator/5.1/Applications/B5A52177-D17C-4479-AB72-01298392983/Documents/*.plist myResourcesFile on device

It's the same if I can be able to copy the Document directory from simulator to the device! 如果我能够将文档目录从模拟器复制到设备,则是相同的!

Any idea?? 任何想法?? I have tried into "Add build phase" and searched into google but don't understand how to do this. 我已尝试进入“添加构建阶段”并搜索到Google,但不知道如何执行此操作。

Can someone help me? 有人能帮我吗?

如果从模拟器复制plist后不需要修改plist,则只需将其从Finder中直接拖放到Xcode项目的resources文件夹中,然后从那里访问即可。

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

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