2

在 Github 上设置了一个示例,我使用的是 Xcode v 9.4.1 https://github.com/iousin/TreeFramework

基本上我正在尝试构建我的框架以在 x86_64 模拟器构建中包含位码。我尝试了各种设置并尝试在命令行上构建,xcodebuild 拒绝在我的模拟器构建中包含位码,但是很高兴将它包含在 arm64(设备)构建中。

以下所有命令应该能够从签出上述框架的同一文件夹中运行。

以下是我尝试构建上述框架的命令:

    xcodebuild ENABLE_BITCODE[sdk=iphone*]=YES BITCODE_GENERATION_MODE=bitcode DYLIB_COMPATIBILITY_VERSION=1 -sdk iphonesimulator -configuration Release -target TreeFramework clean build

    xcodebuild OTHER_CFLAGS="-fembed-bitcode" ENABLE_BITCODE[sdk=iphone*]=YES BITCODE_GENERATION_MODE=bitcode -sdk iphonesimulator -configuration Release -target TreeFramework clean build

    xcodebuild OTHER_CFLAGS="-fembed-bitcode" ENABLE_BITCODE="YES" BITCODE_GENERATION_MODE="bitcode" -sdk iphonesimulator -configuration Release -target TreeFramework clean build

运行以下命令以验证是否发出了位码(在这种情况下不会)。

    otool -arch x86_64 -l build/Release-iphonesimulator/TreeFramework.framework/TreeFramework | grep LLVM

但是,当我为设备构建时,会包含位码。

    xcodebuild -sdk iphoneos -configuration Release -target TreeFramework clean build

验证发出比特码:

    otool -arch arm64 -l build/Release-iphoneos/TreeFramework.framework/TreeFramework | grep LLVM

感谢任何帮助。

4

0 回答 0