sh 在Xcode中从动态库中删除不需要的体系结构 - 来自http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 在Xcode中从动态库中删除不需要的体系结构 - 来自http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-相关的知识,希望对你有一定的参考价值。

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
    FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
    FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
    echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"

    EXTRACTED_ARCHS=()

    for ARCH in $ARCHS
    do
        echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
        lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
        EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
    done

    echo "Merging extracted architectures: ${ARCHS}"
    lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
    rm "${EXTRACTED_ARCHS[@]}"

    echo "Replacing original executable with thinned version"
    rm "$FRAMEWORK_EXECUTABLE_PATH"
    mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"

done

以上是关于sh 在Xcode中从动态库中删除不需要的体系结构 - 来自http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-的主要内容,如果未能解决你的问题,请参考以下文章

从库中删除文件后如何从 Xcode 中删除引用?

如何在 Xcode 中从管理器中删除应用程序?

如何在构建设置中从 xcode 7.2 中删除配置文件

sh 删除.gitignore中列出但仍在存储库中的文件

Xcode:如何在 UIScrollView 中从 XIB 文件添加自定义视图

Xcode 找不到 strip-frameworks.sh 目录