I want to build a static library for iphone. I want to give my users the .a library which they can use for both simulator test and device test. Do I have to build two library in simulator mode and device mode? Is there any way to build a single one that can be used for both platforms?
An XCFramework can be either static or dynamic and can include headers.
type: ~/Library/Application Support/iPhone Simulator.
Compile your library twice. Once using the device SDK, and again using the Simulator SDK.
Then use the lipo
command line tool to create a "fat" library.
lipo -create libdevice.a libsimulator.a -output libcombined.a
That should give you what you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With