Xcode 构建阶段的 Copy Bundle Resources 和 Copy Files 有什么区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11163276/
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-15 00:39:58  来源:igfitidea点击:

What is the difference between Copy Bundle Resources and Copy Files for Xcode build phases?

xcodexcode4.2

提问by Ben Flynn

Could someone explain the difference between the Copy Bundle Resourcesphase of Xcode and a Copy Filesphase? When would I use "Copy Files"?

有人可以解释Copy Bundle ResourcesXcode 的Copy Files阶段和阶段之间的区别吗?我什么时候会使用“复制文件”?

采纳答案by Alladinian

Copy Bundle Resourcesphase copies files that you want to be available in your bundle (.app). On the other hand Copy Filesphase copies files to other (standard) locations accessible from your application (for example to /Library/Fonts) giving you also the option to copy them only when installing. You can also see relevant documentation here

Copy Bundle Resources阶段复制您希望在包 (.app) 中可用的文件。另一方面,Copy Files阶段将文件复制到您的应用程序可访问的其他(标准)位置(例如到 /Library/Fonts),您还可以选择仅在安装时复制它们。您还可以在此处查看相关文档

回答by yoAlex5

Copy Files- Copies files from a project to an externalspecified location.

Copy Files- 将文件从项目复制到外部指定位置。

It is useful, for example, when you are creating an Objective-C Static Librarywhere you should expose .modulemap[About]or/and umbrella.h[About]files

它很有用,例如,当您创建一个 Objective-C 时Static Library,您应该公开.modulemap[About]或/和umbrella.h[About]文件

Copy Bundle Resources- Copies files that support your source code into internalstructure. If you want to make sure the files you added will get copied to the application bundle

Copy Bundle Resources- 将支持源代码的文件复制到内部结构中。如果您想确保您添加的文件将被复制到应用程序包中

It is useful, when you are creating an appwhere you can add images and other resources

当您创建app可以添加图像和其他资源的位置时,这很有用

Read more here

在这里阅读更多