AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

# How to Install the New Relic iOS Agent with CocoaPods

## Summary

To add mobile observability to an iOS app, install the [New Relic](https://newrelic.com/) 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:

```ruby
pod 'NewRelicAgent'
```

2. Install the dependency from Terminal:

```bash
pod install
```

3. Open the generated workspace, not the `.xcodeproj` file:

```bash
open App.xcworkspace
```

4. Start the agent as early as possible in application launch code. In Swift, import `NewRelic` and call:

```swift
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](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-ios/installation/cocoapods-installation/) 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.