Embed a framework for different platforms

Is there a way to embed a framework for different platforms (device vs. iOS simulator) using one Xcode target? (Xcode version is 11.3)


I know that I can add different paths for device vs. simulator, in Target -> Build Settings -> Search Paths -> Framework Search Paths. But under Target -> Build Phases -> Embed Frameworks , when I tried to add a framework twice, under different paths, the Build will fail. What should I do without creating a seperate target ?


Here is a related question, but did not get detailed answer about what exactly should be done: https://forums.developer.apple.com/thread/66978

Accepted Reply

You might want to look at xcframeworks

Replies

You might want to look at xcframeworks

The third-party framework (Cronet from chromium) I am using was not provided as xcframeworks. Its source code is available but has its own build script (not Xcode). I will look into it but not having high hope per my understanding.