Skip to main content
Skip table of contents

Simulator support

Building with simulator support

The Player SDK is built with simulator support to enable you to build and test against an Xcode simulator. When doing so, create a FAT framework (iOS and simulator in one library). You may need to remove arm64 support when building for a simulator. 

FPS encrypted playback is not supported in the simulator

To exclude the arm64 libraries when building for a simulator.

  1. Go to Build Settings and locate Excluded Architectures.
  2. Select Any iOS Simulator SDK for both Debug and Release and set them to exclude arm64.
  3. Repeat for tvOS but select Any tvOS Simulator SDK’ for both Debug and Release.

You should also set the build flag Validate workspace to Yes, as shown below.

Removing simulator support

Upload to the AppStore will be blocked if your application’s archive contains the SDK framework with unsupported simulator architectures and will need to be stripped out before submission.

To remove any unsupported simulator architectures:

  1. Open the Build Phases tab for your application’s target.

  2. Add a Run Script build phase with the + icon.

    The Run Script step must be placed after Embed Frameworks.

  3. Copy and paste the following script, which strips the simulator support from the SDK framework, into the relevant section.

    BASH
         #!/bin/sh
        APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
        find "$APP_PATH" -name 'OPYSDKFPS*.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=()
          DESIRED_ARCHS="arm64"
          lipo -info "$FRAMEWORK_EXECUTABLE_PATH"
          for ARCH in $DESIRED_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: ${DESIRED_ARCHS}"
          lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
          rm "${EXTRACTED_ARCHS[@]}"
          echo "Replacing original"
          rm "$FRAMEWORK_EXECUTABLE_PATH"
          mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
          lipo -info "$FRAMEWORK_EXECUTABLE_PATH"
        done
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.