Building the production version
When code development is complete, create the production version for final testing and submission to the Apple Store.
- Unzip the opy-sdk-ios-prm-2.30.x-production.zip file.
- Either create a new project and repeat the previous procedures, or duplicate your existing project, making the necessary changes to allow the project to be built.
- Replace the patching script (Step 7 in Creating the player) with the one below. The only differences are:
- The invocation of the patch.pyc script does not include the
--no-full-checksum
switch. Removing the switch causes the patcher to encrypt as much of the app as it can, and not just specified parts. - In the line
STRIP_OPTIONS = ""
, the remaining debug symbols are stripped.
In some cases (for example, patching the binary of a library), stripping needs to be more selective. In such cases, modify the value of the STRIP_OPTIONS variable. For example, if the binary is a dynamic library, change
STRIP_OPTIONS = ""
toSTRIP_OPTIONS = "-r -u".
BASHset -e set -x PATCHER_DIR=/nmp-sdk/kop_htc/patcher echo "PATCHER_DIR = " app_binary=/ echo "app binary = " MD5SUM_FILE_PATH=.md5 echo "MD5SUM_FILE_PATH = " PATCH_REQUIRED=true # calculate binary checksum NEW_CHECKSUM=`md5 -q ` echo "new checksum = " # compare against checksum in file if [ -f ]; then OLD_CHECKSUM=`cat ` if [ "" = "" ]; then PATCH_REQUIRED=false echo "No patching required" fi fi # Force using native python export PATH="/usr/bin:" echo "using `which python`" if [ = true ]; then STRIP_OPTIONS="" dylib_PATH=/libcx_checksum.dylib LIPO_CMD="lipo -create -o " for COP_ARCH in ; do lipo -thin -o ..temp LIPO_CMD=" ..temp " python /patch.pyc --patch-oddd ..temp strip ..temp done for COP_ARCH in ; do rm -f ..temp done NEW_CHECKSUM=`md5 -q ` echo > fi
- The invocation of the patch.pyc script does not include the
- Select Product > Scheme > Edit Scheme... and change the build configuration from Debug to Release where relevant.
Removing simulator support
The Player SDK is built with simulator support to enable you to build and test against an Xcode simulator.
Upload to the AppStore will be blocked if your application’s archive contains the SDK framework that contains unsupported simulator architectures. This means that they will need to be stripped out from any version destined for the App Store.
There may be other reasons why the upload is rejected.
The SDK can be tested during integration on the simulator allowing the behaviour and layout across a wide range of devices to be validated.
FPS encrypted playback is not supported in the simulator
To remove any unsupported simulator architectures:
Open the Build Phases tab for your application’s target.
Add a Run Script build phase with the + icon.
The Run Script step must be placed after Embed Frameworks.
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