4

I have an Xcode project that produces an iOS framework. I have two versions of binaries I want to produce - one for internal use, which has no licensing requirements, and one for external use which has licensing requirements.

I figured I would make two targets for this with different swift defines to turn on licensing or not.

But it seems like I have to produce the frameworks with different names, which leads to issues with using import in other projects. I have to either use the one name, or the other name.

Is there a way I can produce two targets with the same name - as in, direct where the binary is produced?

2 Answers 2

4

The solution was to go into each individual target, and change them in the following way:

1) make sure the product name for the target was the name I wanted (as opposed to $(TARGET_NAME)

2) In the "per-configuration Build Products Path", tack on a directory for the target (i.e. one would be "license", and the other would be "internal". This will put the framework in that directory, such that they can be the same name.

I've built both, dragged the resulting framework into my app project, and I can see that they work.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the wonderful question. I having a same situations but I really want to produce two same framework with different name like "Product-Beta.framework" and "Product-Release.framework". Can you please me to figure out this problem ?
0

Thanks for both the question and the answer Joe.

I'd just like to add that using Xcode10 I wasn't able to move the frameworks from the root to the designated groups inside folder hierarchy (Embedding binaries added references to project root). Instead, I had to build both frameworks and drag and drop them into their respective groups. This poses a problem for me because I have to modularize a monolith and separate the UI components. Manually building the frameworks and drag and dropping takes time while writing UI and testing on device. To anyone with the same issue I suggest using a build script to copy the frameworks to their locations, which should save time.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.