zoukankan      html  css  js  c++  java
  • fix LayerKit framework不能提交App Store

    - 问题:

    - 原因

    x86_64, i386是ios模拟器用的architectures.发布时,不支持这两种。但是,默认编译出来的layerkit framework支持这两种编译器

    - 解决办法

    查看layerkit.frameowk所支持的architecture,可以仿照此命令

    $ lipo -info Vendor/RAC/ReactiveCocoa.framework/ReactiveCocoa

    → Architectures in the fat file: ReactiveCocoa are: i386 x86_64 armv7 arm64

    接下来便是,让layerkit.frameowk不支持i386 x86_64这两种architecture,做法如下:

      1. Add a Run Script

      2.  set it to use /bin/sh

      3. 添加如下脚本

    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

      

    转自此链接:

    http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/

  • 相关阅读:
    poj 1579(动态规划初探之记忆化搜索)
    hdu 1133(卡特兰数变形)
    CodeForces 625A Guest From the Past
    CodeForces 625D Finals in arithmetic
    CDOJ 1268 Open the lightings
    HDU 4008 Parent and son
    HDU 4044 GeoDefense
    HDU 4169 UVALive 5741 Wealthy Family
    HDU 3452 Bonsai
    HDU 3586 Information Disturbing
  • 原文地址:https://www.cnblogs.com/ouyangfang/p/5103203.html
Copyright © 2011-2022 走看看