How to copy framework to Frameworks folder?

Hi,


I know that I have to add the "Copy Frameworks" build phase to the program. The issue is that I would like to copy the debug version of the framework to Frameworks when the debug version of the program is being built and the release version of the framework when the release version of the app is being built. How can I achieve this?


At the moment I manage only to select either the debug or release for both builds.


Regards,

Hartwig

Accepted Reply

The framework you want to copy (presumably) exists as an item in your project navigator, probably in Products. Select that, display the File inspector, and change the path referencing mechanism to "relative to build folder". Note that you might have to remove the existing copy from the build phase first, and re-add it afterwards, for the change to take effect.


Edit:


Just to clarify, what I said applies when you build the framework as part of your project or workspace, so that the framework is actually stored in the appropriate build directory. If the 2 framework configurations are built separately, then AFAIK there is no good way except to switch manually.


In that case, you could (I guess) try copying the frameworks manually to the relevant project build folders, and then you could use buld-folder-relative referencing, but if you ever clean the build folders, you would have to re-copy the frameworks.

Replies

The framework you want to copy (presumably) exists as an item in your project navigator, probably in Products. Select that, display the File inspector, and change the path referencing mechanism to "relative to build folder". Note that you might have to remove the existing copy from the build phase first, and re-add it afterwards, for the change to take effect.


Edit:


Just to clarify, what I said applies when you build the framework as part of your project or workspace, so that the framework is actually stored in the appropriate build directory. If the 2 framework configurations are built separately, then AFAIK there is no good way except to switch manually.


In that case, you could (I guess) try copying the frameworks manually to the relevant project build folders, and then you could use buld-folder-relative referencing, but if you ever clean the build folders, you would have to re-copy the frameworks.

Might be easier to run two same-only-different targets, one just for debug, using the debug-centric framework, the other for release. Just be sure to lock it down with several post-its and wite-out on the computer display so it doesn't get used when building for the store 😉