• /
  • Log in
  • Free account

tvOS installation and configuration

Follow these instructions to install and configure the tvOS agent.

Tip

tvOS apps using Cocoapods have separate installation procedures.

Installing your tvOS application

As part of the installation process, New Relic automatically generates an application token. This is a 40-character hexadecimal string for authenticating each mobile app you monitor.

For Admins with existing New Relic accounts, follow these steps to install and configure your application. (If you don't have a New Relic account, signup at newrelic.com/signup—it's free, forever.)

  1. Go to one.newrelic.com and click Mobile.
  2. If applicable: From the Mobile Apps list, select Add a new app
  3. From the Get Started page, select tvOS as the platform for mobile monitoring.
  4. Type a name for your mobile app, and select Continue.

Configuring your tvOS application

These procedures to configure your tvOS app are also available on the Get Started page in the mobile monitoring UI.

  1. Download and unzip the tvOS SDK.

  2. To add the New Relic tvOS Mobile Framework to your Xcode project: Use Finder to drag the NewRelicAgentTVOS.framework folder into your Xcode project, and drop it onto your Project in the Project Navigator window.

  3. Follow the prompts to copy items into destination and to create folder references.

  4. Add the SystemConfiguration.framework, libc++.tbd, and libz.tbd libraries to your Linker settings.

  5. To start the agent: Import the tvOS agent header at the top of your prefix.pch.

  6. Add +[NewRelic startWithApplicationToken:<appToken>] to the top of -application:didFinishLaunchingWithOptions: in your AppDelegate.m using the unique application token that is automatically generated.

  7. Add a build script to your target's Build Phases and paste the following, replacing PUT_NEW_RELIC_APP_TOKEN_HERE with your application token:

    SCRIPT=`/usr/bin/find "${SRCROOT}" -name newrelic_postbuild.sh | head -n 1`
    /bin/sh "${SCRIPT}" "PUT_NEW_RELIC_APP_TOKEN_HERE"
  8. Clean and build your app, and then run it in the simulator or other device.

Within a few minutes you will begin to see data for your iOS app: Go to one.newrelic.com > Mobile > (selected app). If you don't, see No data appears.

Executing a demo crash (optional)

If you have trouble getting your app to crash, the New Relic agent provides an API to execute a demo crash.

Recommendation: Add one of these lines of code to a button click event handler as applicable:

[NewRelic crashNow];

OR

[NewRelic crashNow:@"<reason>"];

Changing the logging level (optional)

Six log levels are available for mobile apps monitoring:

  • none
  • error
  • warning
  • info
  • verbose
  • ALL

To increase your logging level in the app, add this method call before calling startWithApplicationToken:

[NRLogger setLogLevels:NRLogLevelALL];
Create issueEdit page
Copyright © 2022 New Relic Inc.