I would like to create a dynamic framework and distribute it. It needs to work when running on simulator, an iPhone device, and be able to submit to the App Store.
I am aware of lipo thanks to this guide. It shows how we can combine the simulator architectures with the iphone architectures into a single dynamic framework that can be distributed without distributing the source code. It allows me to use the framework for both simulator and iPhone device. However, it fails when I try to send it to the App Store because of the simulator build.
Carthage provides an interesting solution. It creates a framework that works for both simulator and iPhone. But when it is time to send it to the App Store we need to run a script to rip out the simulator slices.
However, the creators of DoubleClick for Publishers (DFP) have found a way to create a framework that works on both simulator and device; Passes the App Store submission; And doesn't require any script to rip out the simulator slices (AFAIK). All I really have to do is drag the GoogleMobileAds.framework file into Linked Frameworks and Libraries. It is a little surprising that I don't need to add it to Embedded Binaries like most dynamic frameworks)
I created a sample project that uses DFP that demonstrates this.
// clone repository
git clone --recursive https://github.com/wh1pch81n/DoubleClickGoogleExample.git
// Move to correct branch
git submodule foreach 'git checkout master'
git submodule foreach 'git pull origin master'
Now you can choose the Simulation_mate scheme and run the app. The app will show a single advertisement banner at the bottom to show that the ad is actually working.
The dependency graph looks like this.
Simulation_mate.app
-> Mate.framework
-> DFP.framework
-> GoogleMobileAds.framework
Again, I can run Simulation_mate on simulator, iPhone, and can submit it to the App Store.
My question is how in the world did they create GoogleMobileAds.framework like this? What steps need to be followed to create a framework like this?
filethe binary file inside the framework to test? Afaik, Google only creates static frameworks in order to support iOS 7.