Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reveal App build phase
#!/bin/bash
# see also http://support.revealapp.com/kb/getting-started/load-the-reveal-server-via-an-xcode-breakpoint
# remove Debug check; change framework path; simplify
# find original one in Reveal.app
set -e
REVEAL_APP_PATH=$(mdfind kMDItemCFBundleIdentifier="com.ittybittyapps.Reveal2" | sort | head -n 1)
[ ! -e "${REVEAL_APP_PATH}" ] && echo "warning: Reveal Server not loaded: Cannot find a compatible Reveal app." && exit 0
echo "Found Reveal at ${REVEAL_APP_PATH}"
[ -e "${PODS_ROOT}/Reveal-SDK" ] && echo "warning: Reveal-SDK found in Pods would be replace by the one on this mac. You can edit the $0 script to forbid this behavior."
if [ "${PLATFORM_NAME}" == "appletvos" ]; then
REVEAL_LIB_DIR="tvOS"
else
REVEAL_LIB_DIR="iOS"
fi
REVEAL_SERVER_FILENAME="RevealServer.framework"
REVEAL_SERVER_PATH="${HOME}/Library/Application Support/Reveal/RevealServer/${REVEAL_LIB_DIR}/${REVEAL_SERVER_FILENAME}"
[ ! -e "${REVEAL_SERVER_PATH}" ] && echo "Reveal Server not loaded: RevealServer.framework could not be found." && exit 1
app_frameworks_dir="${CODESIGNING_FOLDER_PATH}/Frameworks"
mkdir -p "$app_frameworks_dir"
cp -Rf "$REVEAL_SERVER_PATH" "${app_frameworks_dir}/"
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" ]; then
codesign -fs "${EXPANDED_CODE_SIGN_IDENTITY}" "${app_frameworks_dir}/${REVEAL_SERVER_FILENAME}"
fi
echo "${REVEAL_SERVER_FILENAME} is included in this build, and has been copied to $CODESIGNING_FOLDER_PATH"
LLDB_INIT_FILE=~/.lldbinit
LLDB_INIT_MAGIC_STRING="### Reveal LLDB commands support"
if [ ! -e "${LLDB_INIT_FILE}" ] || ! grep -q "${LLDB_INIT_MAGIC_STRING}" "${LLDB_INIT_FILE}"; then
echo "Note: it looks like Reveal Server debugger commands are not installed. Please refer to 'Loading the Reveal Server via an Xcode Breakpoint' section of the Integration Guide for information about loading Reveal Server included in this build."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment