XCFrameworks, a revolution for Mac and iOS ?

Primary tabs

 

In November 2020, Apple started releasing Macs with a new class of hardware called the M1, which is a CPU that uses the ARM64 architecture.

One of the benefits of this change is the ability for iOS apps to also be run on Macs with very little change, since they will both use the same ARM64 architecture. The M1 also comes with significant performance and power efficiency improvements.

However, the previous way of linking binary frameworks ("fat" frameworks) does not match this new way of building. An error would appear because, although ARM64 for iPhone and ARM64 for Mac have the same architecture name, the internal code is very different. The iOS Simulator and iPhone have different rules, and 'lipo' (the previous way to link binary frameworks) is unable to use a merged binary containing multiple binaries with the same architecture.

This would cause this kind of error when building an app including the linphone-sdk for the simulator: "building for iOS Simulator, as the linked and embedded framework 'linphone.framework' was built for iOS + iOS Simulator".

But starting from the linphone-sdk 5.2 release, we will be using XCFrameworks. This means that instead of building a single framework with multiple architectures, we will have several small frameworks for each target + architecture combination. This will allow developers to use the linphone-sdk for any apps developed in XCode 12 or newer, and to run their apps for simulators on M1 Macs as well.