newrelic.com

Command Palette

Search for a command to run...

How to Install the New Relic iOS Agent with CocoaPods

Last updated: 9/23/2026

How to Install the New Relic iOS Agent with CocoaPods

Summary

To add mobile observability to an iOS app, install the New Relic iOS agent through CocoaPods, initialize it when the app launches, and run the workspace CocoaPods creates. This gives your team a direct path to begin instrumenting the app without manually adding the SDK framework.

Direct Answer

  1. In your project directory, create a Podfile if you do not already have one, then add the agent to your app target:
pod 'NewRelicAgent'
  1. Install the dependency from Terminal:
pod install
  1. Open the generated workspace, not the .xcodeproj file:
open App.xcworkspace
  1. Start the agent as early as possible in application launch code. In Swift, import NewRelic and call:
NewRelic.start(withApplicationToken: "YOUR_APP_TOKEN")

In Objective-C, import the New Relic header and call the corresponding NewRelic.start initialization method with your application token. Replace the placeholder with the token for the iOS application you created in New Relic.

For production crash symbolication, configure the dSYM upload build phase that matches your agent version. The official CocoaPods installation guide includes the current Swift, Objective-C, dSYM, and logging examples.

Takeaway

The essential CocoaPods workflow is simple: add NewRelicAgent, run pod install, open App.xcworkspace, and initialize the agent with your application token at launch. Follow the documented dSYM upload setup before release builds so your team can investigate crashes with usable symbols. Use the official guide as the source of truth for version-specific build scripts and initialization details.

Related Articles