I have a third party framework customx.framework
(iOS) customx.framework
(Simulator).
To run project on simulator customx.framework
(Simulator) to be imported & for device
customx.framework
(iOS) to be imported
simultaneously importing is not supported by xcode
At present i am manually importing framework, so i am looking for runtime scrip changes or combined (iOS+Simulator) framework to import in xcode project.
For that
- I have tried
lipo
&libtool
but seems didn’t worked. - I used validate workspace but it fails when importing modules.
tried links –
iOS merge several framework into one
Building for iOS Simulator, but the linked framework '****.framework' was built for iOS
2
Answers
Supported. It is named XCFramework.
So assuming each variant of frameworks have been built correctly (pay attention that
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
, just in case – Xcode set it to YES automatically), join them in terminal or Xcode script phase with next command:and then add it once in target dependency
and that’s it.
You can archive for iOS device and iOS simulator and merge them to one xcframework. This is my current project xcodebuild command for it.