How to build framework with fastlane?

Viewed 4303

It's very easy building ipa using fastlane gym. But my aim is building a framework. It works for build a framework below:

gym(
  clean: true,
  scheme: "SGVSDK",
  project: "../Prj/SDK/SGVSDK.xcodeproj",
  # build_path: "./",
  archive_path: "./" + archiveName,
  skip_package_ipa: true,
)

But it can only build device framework? How to build a simulator framwork? Are there any tip for me for SDK CI using fastlane ?

2 Answers

What worked for me was creating aggregate target for building universal framework (for simulator and device) with additional sh script as described in tutorial here: https://medium.com/@syshen/create-an-ios-universal-framework-148eb130a46c Then in fastfile I build aggregate target like this:

xcodebuild(
    scheme: "Framework-Universal",
    configuration: "Release",
    clean: true,
    build: true
)

I used fastlane swift to build aggregated framework using the following function, maybe it helps you.

buildIosApp(workspace: "PayTabs.xcworkspace", 
scheme: "Aggregated Framework", 
clean: true, 
configuration: "Release", 
skipPackageIpa: true, 
includeSymbols: false, 
skipArchive: true)
Related