bielikb / xcframeworks

Demonstration of creating and integrating xcframeworks and their co-op with static libraries and Swift packages
MIT License
536 stars 46 forks source link

Help pls with understood how make xcframeowrks? #14

Open bimawa opened 2 years ago

bimawa commented 2 years ago

xcode 13.4 trying move from fat to xcframework.

  1. I create the package by: 'swift package init --type library`;
  2. Move our sources to Source folder;
  3. Generate archive for iOS:
    xcodebuild archive -scheme TestFramework \
            -destination "generic/platform=iOS" \
            -archivePath ./Archive-iOS \
            -derivedDataPath ".build" \
            SKIP_INSTALL=NO \
            BUILD_LIBRARY_FOR_DISTRIBUTION=YES
  4. Generate archive for iOS Simulator:
    xcodebuild archive -scheme TestFramework \
            -destination "generic/platform=iOS Simulator" \
            -archivePath ./Archive-iOSSimulator \
            -derivedDataPath ".build" \
            SKIP_INSTALL=NO \
            BUILD_LIBRARY_FOR_DISTRIBUTION=YES
  5. Generate the xcframework by docs:
    xcodebuild -create-xcframework \
    -framework './Archive-iOS.xcarchive/Products/Library/Frameworks/TestFramework.framework' \
    -framework './Archive-iOSSimulator.xcarchive/Products/Library/Frameworks/TestFramework.framework' \
    -output './Archive-iOS.xcarchive.xcframework'

    got error: error: unable to read the file -> ./Archive-iOS.xcarchive/Products/Library/Frameworks/TestFramework.framework/TestFramework

Ofc, because on steps 3,4 I haven't this framework in archive. Where can I found correct documentation with step by step for make xcframeworks? What I did wrong?