Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Copy Files Build Phase - what do the "Destination" options mean?

Xcode Copy Files Build PhaseDestinations

The Xcode docs for this don't explain exactly where each of the Destination paths maps to on disc, relative to my application package.

If I use this app as an example, could someone give a canonical answer where each will put files relative to this directory structure?

Xcode directory structure

like image 687
Mr. Boy Avatar asked Oct 03 '13 10:10

Mr. Boy


1 Answers

The app bundle in your example is Viewer. This is not a file; it's a directory. If you click on it and "Show Package Contents", you'll see the rest of it.

Products Directory is the directory that Viewer is written to. You cannot write to this directory in iOS.

For iOS, Wrapper is the top level directory within Viewer.

For iOS, Executable is the same directory as Wrapper.

For iOS, Resources go into either the Wrapper directory, or the localization directories (Base.lproj, etc) if the resource is localized.

The other directories aren't meaningful for iOS.

Still, you should use the directories logically. Use "Executable" to mean "the directory where my executable lives." Don't assume that the directory tree is laid out a particular way internally.

Regarding you comment that you need to know the path to access the file, you do not need that (and shouldn't try). You should use [NSBundle pathForResource:ofType:] to find files.

like image 162
Rob Napier Avatar answered Oct 28 '22 02:10

Rob Napier