gpt4 book ai didi

ios - 从命令行终端使用位码启用和位码禁用为设备和通用配置创建 iOS 框架

转载 作者:行者123 更新时间:2023-11-28 18:48:04 24 4
gpt4 key购买 nike

#!/bin/sh

UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal

# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"

# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO \
-configuration ${CONFIGURATION} -sdk iphoneos \
BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} \
-sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" \
BUILD_ROOT="${BUILD_ROOT}" clean build

# Step 2. Copy the framework structure (from iphoneos build) to the universal folder
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/"


# Step 4. Create universal binary file using lipo and place the combined executable in the copied framework directory
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" \
"${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" \
"${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}"

# Step 5. Convenience step to copy the framework to the project's directory
cp -R "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}"

# Step 6. Convenience step to open the project's directory in Finder
open "${PROJECT_DIR}"

我有上面的 shell 脚本来从 Xcode 构建选项创 build 备框架和通用框架。

是否可以使用上面的 shell 脚本和下面的配置从命令终端创建/生成 iOS 框架???

  • 1) 为设备位码禁用创建框架
  • 2) 为设备位码启用创建框架
  • 3) 为通用位码禁用创建框架
  • 4) 为通用位码启用创建框架

Please let me know the steps to create/generate iOS Framework from command terminal. Must appreciate for the best explanation

最佳答案

只需将参数添加到您的xcodebuild

ENABLE_BITCODE=NO 用于禁用位码

ENABLE_BITCODE=YES 用于启用位码

例如

xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build ENABLE_BITCODE=NO

关于ios - 从命令行终端使用位码启用和位码禁用为设备和通用配置创建 iOS 框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46808851/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com