Skip to content

create_xcframework

Community Action Reference: Inspected directly from Fastlane core ruby gem definitions.

Supported Platforms: ios, mac

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

Details

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 one of:

  • An array containing the list of frameworks using the :frameworks parameter (if they have no associated dSYMs): [‘FrameworkA.framework’, ‘FrameworkB.framework’]

  • A hash containing the list of frameworks with their dSYMs using the :frameworks_with_dsyms parameter: { ‘FrameworkA.framework’ => {}, ‘FrameworkB.framework’ => { dsyms: ‘FrameworkB.framework.dSYM’ } }

If you want to package several libraries just provide one of:

  • An array containing the list of libraries using the :libraries parameter (if they have no associated headers or dSYMs): [‘LibraryA.so’, ‘LibraryB.so’]

  • A hash containing the list of libraries with their headers and dSYMs using the :libraries_with_headers_or_dsyms parameter: { ‘LibraryA.so’ => { dsyms: ‘libraryA.so.dSYM’ }, ‘LibraryB.so’ => { headers: ‘headers’ } }

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

Parameters & Options

Total options available: 6

Key Type Env Variable Default Required Description
frameworks Array FL_CREATE_XCFRAMEWORK_FRAMEWORKS - No Frameworks (without dSYMs) to add to the target xcframework
frameworks_with_dsyms Hash FL_CREATE_XCFRAMEWORK_FRAMEWORKS_WITH_DSYMS - No Frameworks (with dSYMs) to add to the target xcframework
libraries Array FL_CREATE_XCFRAMEWORK_LIBRARIES - No Libraries (without headers or dSYMs) to add to the target xcframework
libraries_with_headers_or_dsyms Hash FL_CREATE_XCFRAMEWORK_LIBRARIES_WITH_HEADERS_OR_DSYMS - No Libraries (with headers or dSYMs) to add to the target xcframework
output String FL_CREATE_XCFRAMEWORK_OUTPUT - Yes The path to write the xcframework to
allow_internal_distribution Fastlane::Boolean FL_CREATE_XCFRAMEWORK_ALLOW_INTERNAL_DISTRIBUTION false No Specifies that the created xcframework contains information not suitable for public distribution

Lane Context Shared Values

This action writes the following values to Actions.lane_context[SharedValues::...]:

Key Description
SharedValues::XCFRAMEWORK_PATH Location of the generated xcframework

Examples

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

Source & Upstream