Christian Sousa
04/06/2020, 4:00 PM.framework
into one single file? So I wouldn’t need to provide both versions, one for simulator and one for devices.
I tried using the following script:
# create folder where we place built frameworks
mkdir build
# create folder to store compiled framework for simulator
mkdir build/simulator
# copy compiled framework for simulator into our build folder
cp -r debugFramework/MyLib.framework build/simulator
# create folder to store compiled framework for simulator
mkdir build/devices
# copy compiled framework for simulator into our build folder
cp -r releaseFramework/MyLib.framework build/devices
# create folder to store compiled universal framework
mkdir build/universal
####################### Create universal framework #############################
# copy device framework into universal folder
cp -r build/devices/MyLib.framework build/universal/
# create framework binary compatible with simulators and devices, and replace binary in unviersal framework
lipo -create build/simulator/MyLib.framework/MyLib build/devices/MyLib.framework/MyLib -output build/universal/MyLib.framework/MyLib
# copy simulator Swift public interface to universal framework
cp build/simulator/MyLib.framework/Modules/MyLib.swiftmodule/* build/universal/MyLib.framework/Modules/MyLib.swiftmodule
But it fails with:
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: build/simulator/MyLib.framework/MyLib and build/devices/MyLib.framework/MyLib have the same architectures (x86_64) and can't be in the same fat output file
Kris Wong
04/06/2020, 4:09 PMChristian Sousa
04/06/2020, 4:10 PMKris Wong
04/06/2020, 4:43 PMChristian Sousa
04/06/2020, 5:58 PMiosArm64.binaries.getFramework("DEBUG"),
iosX64.binaries.getFramework("DEBUG"),
iosArm64.binaries.getFramework("RELEASE"),
iosX64.binaries.getFramework("RELEASE")
gets me this:
ERROR: This fat framework already has a binary for architecture `arm64` (debugFramework for target `ios`)
Kris Wong
04/06/2020, 6:12 PMChristian Sousa
04/06/2020, 6:13 PM