How to link device only frameworks in our app

We have received 3rd party frameworks that work only for iPad/iPhone.

When we build our app for Simulator we need to remove those frameworks from frameworks and libraries.

When we build our app for devices we need to add those frameworks back into frameworks and libraries.

What is the clean way to link such frameworks?

Probably the easiest method would be to have another duplicate target. e.g. WeatherSimulator, WeatherDevice. Keep the app targets in sync, except for the link frameworks. The Simulator build won't have the framework. The device build will include the framework.

Another option, perhaps, in your current setup (one target) might be to have the framework weakly linked. Add a Run Script phase to remove the framework on the Simulator. Not sure this will work, but worthy of a try.
How to link device only frameworks in our app
 
 
Q