With Xcode 6 we get ability to create own Dynamic Cocoa Frameworks
.
Because of:
Simulator still use
32-bit
library-
beginning June 1, 2015 app updates submitted to the App Store must include 64-bit support and be built with the iOS 8 SDK (developer.apple.com)
We have to make fat library to run project on devices and simulators. i.e. support both 32 and 64 bit in Frameworks.
But I didn't find any manuals, how to export universal fat Framework for future integration with other projects (and share this library with someone).
Here is my steps to reproduce:
Set
ONLY_ACTIVE_ARCH=NO
in theBuild Settings
Add support
armv7 armv7s arm64 i386 x86_64
toArchitectures
(for sure)
- Build Framework and open it in Finder:
- Add this framework to another project
Actual result:
But in the end I still have problem with running project with this framework on devices and simulator at once.
if I take framework from
Debug-iphoneos
folder - it works on devices and gets error on simulators:ld: symbol(s) not found for architecture i386
xcrun lipo -info CoreActionSheetPicker
Architectures in the fat file: CoreActionSheetPicker are: armv7 armv7s arm64
if I take framework from
Debug-iphonesimulator
folder - it works on simulators. and I have error on device:ld: symbol(s) not found for architecture arm64
xcrun lipo -info CoreActionSheetPicker
Architectures in the fat file: CoreActionSheetPicker are: i386 x86_64
So, how to create a dynamic framework that works on devices and simulators?
This answer related to Xcode 6 iOS Creating a Cocoa Touch Framework - Architectures issues but it's not duplicate.
Update:
I found a "dirty hack" for this case. See my answer below. If someone knows more convenient way - please, let me know!