Search code examples
iosxcodeframeworksxcode7carthage

In Xcode 7 how can I have a static lib target and a framework target with the same name?


I'm trying to convert an existing GitHub repo (RMStore, but it could apply to any repo) to be compatible with Carthage. This requires adding a Framework target to the Xcode Project. I want the resulting framework to be called RMStore.framework, however I cannot create a new target to the Xcode project called RMStore because there is already a target with that name, which builds a static library (and I don't want to get rid of that target).

I created a new target called RMStoreFramework, but the resulting framework is called RMStoreFramework.framework, which is not what I want. So, is there a way to either:

  1. create two targets with the same name or alternatively,
  2. make the name of the resulting framework be different to the target name?

Solution

  • You can change the name of resulting framework. On Build Settings -> Product Name, you can choose the name that you want.

    This pattern can be seen in projects that support Carthage and support both iOS and Mac platforms.