New Relic Mobile now comes with more chocolate! Well, more CocoaPods support, I should say. That’s right, we are now officially adding support for CocoaPods in your iOS apps.
Adding New Relic to CocoaPods couldn’t be easier! Every time we release new versions of the iOS agent, we will update the “NewRelicAgent” Podspec, so you’ll always have the latest and greatest release.
For mobile developers who are already using CocoaPods, simply follow the steps below and in moments, you’ll be on your way to consuming delicious data. For those of you who aren’t using CocoaPods, head over to the CocoaPods site to get started and then come back to add New Relic!
Here are the five simple steps:
In the Podfile for your project, add the following line:
Close your project in Xcode, and update it by running this command from the Terminal in your project directory:
Open your project in Xcode by running this command (replacing “App” with your app name) from the Terminal in your project directory:
In your [app_name]-Prefix.pch project file (generally found in the Supporting Files folder), include the New Relic header:
In your AppDelegate.m file, add this call as the first line of application:didFinishLaunchingWithOptions:
Clean and build your app, and then run it in the simulator or another device.
Now that you’ve installed New Relic in your app, within minutes you will see all the awesome New Relic Mobile performance monitoring data in your New Relic account dashboard.
Happy mobile monitoring!