Skip to content

Instantly share code, notes, and snippets.

@hammadzz
Last active March 29, 2017 21:08
Show Gist options
  • Save hammadzz/3373609a8d0e62f1df92dd45dfe02540 to your computer and use it in GitHub Desktop.
Save hammadzz/3373609a8d0e62f1df92dd45dfe02540 to your computer and use it in GitHub Desktop.
This script uploads the dSYMs to new relic as needed to symbolicate crashes on iOS
# New Relic's script that uploads dSYMs automatically (required to symbolicate crashes)
SCRIPT=`/usr/bin/find "${SRCROOT}" -name newrelic_postbuild.sh | head -n 1`
# Reading tokens from info.plist for this target from keys are "NewRelicToken[Prod/Dev/Debug]"
PROD_TOKEN="$(defaults read "${PRODUCT_SETTINGS_PATH}" NewRelicTokenProd)"
DEV_TOKEN="$(defaults read "${PRODUCT_SETTINGS_PATH}" NewRelicTokenDev)"
# Select token for configuration
if [ ${CONFIGURATION} = "AppStore" ]; then
echo "Using Production Agent Token"
AGENT_TOKEN=$PROD_TOKEN
else
echo "Using Dev Agent Token"
AGENT_TOKEN=$DEV_TOKEN
fi
/bin/sh "${SCRIPT}" "${AGENT_TOKEN}"
# Reads from build settings
if [ -n "$NEW_RELIC_TOKEN" ]; then
echo "Running NewRelic run script for ${CONFIGURATION} configuration with token: ${NEW_RELIC_TOKEN}"
# New Relic's script that uploads dSYMs automatically (required to symbolicate crashes)
SCRIPT=`/usr/bin/find "${SRCROOT}" -name newrelic_postbuild.sh | head -n 1`
#/bin/sh "${SCRIPT}" "${NEW_RELIC_TOKEN}"
else
echo "Skipping NewRelic run script for ${CONFIGURATION} configuration: token not found"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment