ios xcframework合成

编译xcframework 记录

编译xcframework

配置信息

target name: kdslll

project name: kdslll.xcodeproj

文件路径:/Users/zuiyou/Downloads/kdslll

脚本

  1. 编译包含所有模拟器的framework
1
2
3
4
5
6
7
8
9
10
11
xcodebuild GCC_PREPROCESSOR_DEFINITIONS='$(inherited)'  \
-sdk iphonesimulator \
ARCHS='arm64 x86_64' \
CONFIGURATION_BUILD_DIR=/Users/zuiyou/Downloads/kdslll/build_simulator/ \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
clean \
build -configuration Release \
-target kdslll \
GCC_GENERATE_DEBUGGING_SYMBOLS=YES \
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" \
-project kdslll.xcodeproj 2>&1
  1. 编译真机framework
1
2
3
4
5
6
7
8
9
10
xcodebuild GCC_PREPROCESSOR_DEFINITIONS='$(inherited)'  \
ARCHS='arm64' \
CONFIGURATION_BUILD_DIR=/Users/zuiyou/Downloads/kdslll/build_mobile/ \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
clean \
build -configuration Release \
-target kdslll \
GCC_GENERATE_DEBUGGING_SYMBOLS=YES \
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" \
-project kdslll.xcodeproj 2>&1
  1. 合并
1
2
3
xcrun xcodebuild -create-xcframework -framework build_mobile/
kdslll.framework -framework build_simulator/kdslll.framework -output
kdslll.xcframework

导入

导入到项目中需要配置一下,将Embed方式修改一下

备注

感谢同事孙佳琪的无私奉献


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!