newrelic / newrelic-ios-agent-spm

This repository hosts the Swift Package Manager deployment of the iOS agent
Apache License 2.0
15 stars 9 forks source link

Build Phase Script for v7.4.0+ #26

Open shahzadmajeed opened 1 year ago

shahzadmajeed commented 1 year ago

Which one is more accurate for 7.4.0+?

  1. The documentation says use following
ARTIFACT_DIR="${BUILD_DIR%Build/*}SourcePackages/artifacts"

SCRIPT=`/usr/bin/find "${SRCROOT}" "${ARTIFACT_DIR}" -type f -name run-symbol-tool | head -n 1`
/bin/sh "${SCRIPT}" "APP_TOKEN"

OR

  1. SPM README says use following
    "${BUILD_DIR%/Build/*}/SourcePackages/artifacts/newrelic-ios-agent-spm/NewRelic.xcframework/Resources/run-symbol-tool" "APP_TOKEN"

Looks like both are trying to locate & execute run-symbol-tool but want to make sure document is consistent

cdillard-NewRelic commented 1 year ago

Thank you for brining this documentation difference to our attention.

Either script will work for iOS agent 7.4.0+ with SPM. More details below:

1.) This is a newer version of the script that works with our SPM, Cocoapods, and XCFramework distributions. This script will work with all iOS agent installation methods. 2.) This is a direct version of the run-symbol-tool script without using find. It only works if you installed the iOS agent with SPM. As long as you are using the SPM version of the iOS agent, either code snippet will work for your Run Script Phase.

Thanks for using the iOS agent.

AnshulMindbody commented 1 year ago

"${BUILD_DIR%/Build/*}/SourcePackages/artifacts/newrelic-ios-agent-spm/NewRelic.xcframework/Resources/run-symbol-tool" "APP_TOKEN"

@cdillard-NewRelic this script is not working with Xcode 14.3, MAC OS 13 and M1 MAC.

cdillard-NewRelic commented 1 year ago

The following script will work now. Note the changed path where we added NewRelic folder.

"${BUILD_DIR%/Build/*}/SourcePackages/artifacts/newrelic-ios-agent-spm/NewRelic/NewRelic.xcframework/Resources/run-symbol-tool" "APP_TOKEN"

Thank you for reporting this. I can confirm there is an issue in the direct version of the script in Xcode 14.3. We'll update our documentation for this. You can also use script 1.) which uses the find command and will work.

AnshulMindbody commented 1 year ago

Thank @cdillard-NewRelic new script is working in Xcode 14.3.

AnshulMindbody commented 1 year ago

@cdillard-NewRelic another think I observed after downgrading new relic version to 7.4.3 - 7.4.0 and uploading the dysm, crash log is not symbolicated.