iOS9: Using dynamic framework with Simulator and Device

核能气质少年 提交于 2019-12-03 13:38:59
arc4randall

What you are looking to do is build a "Universal Framework". I answered a question about this here, but I will summarize the main points for you:

The reason you aren't able to compile it because the simulator runs on a different architecture than a device. Also, different iPhone models run on different architectures. You can look at this image to see what devices run on each architecture. The simulator runs on the mac arcs, which are i386 and x86. What you need to do is build for each architecture, then merge them all together through a process called "lipo".

To do this you want to set "Build Active Architectures" to NO. Then you should build your framework for a "Generic iOS Device". Then if you copy the build script from my first link, and put it as an aggregate target, this will build out each architecture and merge them into what will be your final product. This is called a FAT framework, and you can then run the command "lipo -info" in the terminal and you will see that your framework contains all architectures, which is what you want.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!