create_xcframework

Package multiple build configs of a library/framework into a single xcframework

Utility for packaging multiple build configurations of a given library
or framework into a single xcframework.

If you want to package several frameworks just provide an array containing
the list of frameworks to be packaged using the :frameworks parameter.

If you want to package several libraries with their corresponding headers
provide a hash containing the library as the key and the directory containing
its headers as the value (or an empty string if there are no headers associated
with the provided library).

Finally specify the location of the xcframework to be generated using the :output
parameter.

create_xcframework
Supported platforms ios, mac
Author @jgongo

2 Examples

create_xcframework(frameworks: ['FrameworkA.framework', 'FrameworkB.framework'], output: 'UniversalFramework.xcframework')
create_xcframework(libraries: { 'LibraryA.so' => '', 'LibraryB.so' => 'LibraryBHeaders'}, output: 'UniversalFramework.xcframework')

Parameters

Key Description Default
frameworks Frameworks to add to the target xcframework
libraries Libraries to add to the target xcframework, with their corresponding headers
output The path to write the xcframework to
allow_internal_distribution Specifies that the created xcframework contains information not suitable for public distribution false

* = default value is dependent on the user's system


Lane Variables

Actions can communicate with each other using a shared hash lane_context, that can be accessed in other actions, plugins or your lanes: lane_context[SharedValues:XYZ]. The create_xcframework action generates the following Lane Variables:

SharedValue Description
SharedValues::XCFRAMEWORK_PATH Location of the generated xcframework

To get more information check the Lanes documentation.


Documentation

To show the documentation in your terminal, run

fastlane action create_xcframework

CLI

It is recommended to add the above action into your Fastfile, however sometimes you might want to run one-offs. To do so, you can run the following command from your terminal

fastlane run create_xcframework

To pass parameters, make use of the : symbol, for example

fastlane run create_xcframework parameter1:"value1" parameter2:"value2"

It's important to note that the CLI supports primitive types like integers, floats, booleans, and strings. Arrays can be passed as a comma delimited string (e.g. param:"1,2,3"). Hashes are not currently supported.

It is recommended to add all fastlane actions you use to your Fastfile.


Source code

This action, just like the rest of fastlane, is fully open source, view the source code on GitHub


Back to actions