7

My project uses third-party xcframeworks but one of the xcframework does not support simulator which leads to building fail. Is there any way to exclude that particular xcframework from simulator build but in device build?

JohnC
  • 209
  • 4
  • 16
  • There is a build setting called `Excluded Architecture` which I think can do what you want. Check out the this question / accepted answer, https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios?page=1 – anders Jun 28 '21 at 01:17
  • How do you integrate 3rd-party xcframework into your project? Do you use cocoapods for that? Or do you manage dependencies manually? – Eugene Dudnyk Jun 28 '21 at 17:52
  • 1
    You can create separate `targets`, and add/remove specific frameworks. If there are code dependencies, then you may need to add specific `if` conditions to exclude specific code for simulators. – Dileep Jun 29 '21 at 13:57
  • 1
    Realistically if the upstream developers can not develop an xcframework that supports the simulator then the next best thing is add support yourself. Implement a dummy version of the library's public interface (leave the methods body empty), and build a framework for the architecture "generic/platform=iOS Simulator", then add this to the xcframework, modify the Info.plist to indicate the platform and you are good to go. – Christos Koninis Jun 30 '21 at 06:37

0 Answers0