Manually Installing the TUNE iOS SDK

To install manually, follow the steps below:

  1. Unzip and copy the Tune.framework folder into your source tree.
  2. Add the Tune.framework to your Xcode® project:
    1. At the top of the Project Navigator, click the project name.
    2. On the General tab, scroll down to the bottom to see (Linked Frameworks and Libraries).
    3. To add a new framework, click the “+” sign, and then click Add Other….
    4. Browse to and select the Tune.framework folder, and then click Open.

  3. Add the following additional frameworks to your project:
    • AdSupport.framework
    • CoreLocation.framework
    • CoreSpotlight.framework
    • CoreTelephony.framework
    • iAd.framework
    • libz.tbd
    • MobileCoreServices.framework
    • QuartzCore.framework
    • Security.framework
    • StoreKit.framework
    • SystemConfiguration.framework
    • UserNotifications.framework (only on Xcode 8 to support iOS 10+)
  4. Add the following flags to "Other Linker Flags" in the Xcode project Build Settings.
    -ObjC -lz
  5. Add the Tune.framework to the Embed Frameworks build phases.
  6. Add the following script to the Run Script build phases to strip out simulator slices from the Tune.framework .
    echo "Target architectures: $ARCHS"
    
    APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
    
    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"
    echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH")
    
    FRAMEWORK_TMP_PATH="$FRAMEWORK_EXECUTABLE_PATH-tmp"
    
    # remove simulator's archs if location is not simulator's directory
    case "${TARGET_BUILD_DIR}" in
    *"iphonesimulator")
    echo "No need to remove archs"
    ;;
    *)
    if $(lipo "$FRAMEWORK_EXECUTABLE_PATH" -verify_arch "i386") ; then
    lipo -output "$FRAMEWORK_TMP_PATH" -remove "i386" "$FRAMEWORK_EXECUTABLE_PATH"
    echo "i386 architecture removed"
    rm "$FRAMEWORK_EXECUTABLE_PATH"
    mv "$FRAMEWORK_TMP_PATH" "$FRAMEWORK_EXECUTABLE_PATH"
    fi
    if $(lipo "$FRAMEWORK_EXECUTABLE_PATH" -verify_arch "x86_64") ; then
    lipo -output "$FRAMEWORK_TMP_PATH" -remove "x86_64" "$FRAMEWORK_EXECUTABLE_PATH"
    echo "x86_64 architecture removed"
    rm "$FRAMEWORK_EXECUTABLE_PATH"
    mv "$FRAMEWORK_TMP_PATH" "$FRAMEWORK_EXECUTABLE_PATH"
    fi
    ;;
    esac
    
    echo "Completed for executable $FRAMEWORK_EXECUTABLE_PATH"
    echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH")
    
    done

No Comments

Leave a reply