newrelic / newrelic-react-native-agent

New Relic Mobile Agent SDK for React-Native Applications
Apache License 2.0
16 stars 21 forks source link

How-To Guide On Uploading dSYM Files Using Expo EAS #136

Open itajenglish opened 11 months ago

itajenglish commented 11 months ago

Summary

Many companies use Expo and Expo EAS to manage the React Native build process. It would be great to get a guide on how to upload dSYM files to NewRelic using Expo EAS.

Desired Behavior

Possible Solution

Additional context

objectiveSee commented 10 months ago

+1! We also need JS stack traces.

ndesai-newrelic commented 10 months ago

@objectiveSee this is for ios symbolication. which we are supported.

ndesai-newrelic commented 10 months ago

@itajenglish you need to follow this to upload DSYM.
With the 7.4.6 release, the XCFramework no longer includes the dsym-upload-tools. You can find the dsym-upload-tools in the dsym-upload-tools folder of the https://github.com/newrelic/newrelic-ios-agent-spm Swift Package Manager repository. Please copy the dsym-upload-tools directory into your application source code directory by copying the XCFramework into your project or using Cocoapods if you're integrating the New Relic iOS Agent. Use the run script below in your Xcode build phases to perform symbol upload steps during app builds in Xcode.

*ARTIFACT_DIR="${BUILD_DIR%Build/}" SCRIPT=/usr/bin/find "${SRCROOT}" "${ARTIFACT_DIR}" -type f -name run-symbol-tool | head -n 1 /bin/sh "${SCRIPT}" "APP_TOKEN"** We recommend using the swift package manager for your installation method.

itajenglish commented 10 months ago

@itajenglish you need to follow this to upload DSYM. With the 7.4.6 release, the XCFramework no longer includes the dsym-upload-tools. You can find the dsym-upload-tools in the dsym-upload-tools folder of the https://github.com/newrelic/newrelic-ios-agent-spm Swift Package Manager repository. Please copy the dsym-upload-tools directory into your application source code directory by copying the XCFramework into your project or using Cocoapods if you're integrating the New Relic iOS Agent. Use the run script below in your Xcode build phases to perform symbol upload steps during app builds in Xcode.

*ARTIFACT_DIR="${BUILD_DIR%Build/}" SCRIPT=/usr/bin/find "${SRCROOT}" "${ARTIFACT_DIR}" -type f -name run-symbol-tool | head -n 1 /bin/sh "${SCRIPT}" "APP_TOKEN"** We recommend using the swift package manager for your installation method.

@ndesai-newrelic Thank you for this, however, we don't interact with Xcode when using Expo. Our local builds are handled by the Expo CLI and our production builds are handled by Expo's EAS service. Is it possible to get a solution similar to Sentry?

jake-carpenter commented 5 months ago

I spent some time trying to figure this out today. It's really disappointing that the NR team doesn't want to provide any avenue to upload these outside of Xcode integration. That simply won't cut it for modern React-Native development. You'd think at minimum we could manually upload our dSYM.

For what it's worth to anyone who finds it useful, you can get the dSYM file from EAS:

  1. Add buildArtifactsPath setting to the iOS section in your build profile:
{
  "build": {
    "production": {
      "ios": {
        "buildArtifactPaths": ["ios/build/*"]
      }
    }
  }
}
  1. Request the artifact via command line npx eas-cli build:list --json --non-interactive --platform=ios --limit 1 | jq '.[0].artifacts.buildArtifactsUrl' | xargs wget

  2. Rename the hideous file (optional) mv artifacts-*.tar.gz* artifacts.tar.gz

  3. Extract mkdir artifacts && tar xzvf artifacts.tar.gz -C artifacts

Your dSYM is now in ./artifacts/ios/build

itajenglish commented 5 months ago

I spent some time trying to figure this out today. It's really disappointing that the NR team doesn't want to provide any avenue to upload these outside of Xcode integration. That simply won't cut it for modern React-Native development. You'd think at minimum we could manually upload our dSYM.

For what it's worth to anyone who finds it useful, you can get the dSYM file from EAS:

  1. Add buildArtifactsPath setting to the iOS section in your build profile:
{
  "build": {
    "production": {
      "ios": {
        "buildArtifactPaths": ["ios/build/*"]
      }
    }
  }
}
  1. Request the artifact via command line npx eas-cli build:list --json --non-interactive --platform=ios --limit 1 | jq '.[0].artifacts.buildArtifactsUrl' | xargs wget
  2. Rename the hideous file (optional) mv artifacts-*.tar.gz* artifacts.tar.gz
  3. Extract mkdir artifacts && tar xzvf artifacts.tar.gz -C artifacts

Your dSYM is now in ./artifacts/ios/build

Agreed! Thanks for sharing this @jake-carpenter

ndesai-newrelic commented 5 months ago

@jake-carpenter this documentation provides instructions on how to upload dsym files manually, without using Xcode, for symbolicated crash reporting. https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-ios/configuration/upload-dsyms-bitcode-apps/#manual-dsym .