Newrelic Ios Agent Spm banner
newrelic newrelic

Newrelic Ios Agent Spm

Development community

Description

This repository hosts the Swift Package Manager deployment of the iOS agent

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

[![Community Project header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Project.png)](https://opensource.newrelic.com/oss-category/#community-project)

New Relic Swift Package Manager Deployment

New Relic's mobile monitoring capabilities help you gain deeper visibility into how to analyze your iOS application performance and troubleshoot crashes. You can also examine HTTP and other network performance for unexpected lag, which will in turn help you collaborate more efficiently with your backend teams.

Release Notes

https://docs.newrelic.com/docs/release-notes/mobile-release-notes/xcframework-release-notes/

Installation

  1. Select File > Swift Packages > Add Package Dependency....
  2. Add the Github URL of the Package file:
https://github.com/newrelic/newrelic-ios-agent-spm

If you receive an `artifact of binary target 'NewRelic' failed extraction: The operation couldn’t be completed. (TSCBasic.StringError error 1.)` error when extracting the package, please close Xcode, delete the Derrived Data folder, re-open Xcode, and try again.

  1. Select the NewRelic package product, select your target, and select Finish.

  2. In your `AppDelegate.swift` file, add this call as the first line of `applicationDidFinishLaunchWithOptions`, replacing `APP_TOKEN` with your [application token](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/maintenance/viewing-your-application-token):

    NewRelic.start(withApplicationToken:"APP_TOKEN")

    To ensure proper instrumentation, you must call the agent on the first line of `didFinishLaunchingWithOptions()`, and run the agent on the main thread. Starting the call later, on a background thread, or asynchronously can cause unexpected or unstable behavior.

  3. Add a build script to your target's **Build Phases**. Ensure the new build script is the very last build script. Then paste the following snippet, replacing `APP_TOKEN` with your