Follow these instructions to install the New Relic Unity plugin. The plugin includes Android and iOS agent files which embed appropriately for your build. To instrument interactions and network requests, you must use the Unity API to manually instrument your code.
Install the Unity plugin
As part of the installation process, New Relic Mobile automatically generates an application token. This is a 40-character hexadecimal string for authenticating each mobile project you monitor in New Relic Mobile.
For Admins with existing New Relic accounts, follow these steps to install and configure your Unity application. (If you do not have a New Relic account, see New Relic Mobile.)
- Go to rpm.newrelic.com/mobile.
- From the Mobile Apps list, select Add a new app.
- From the Get Started page, select Unity as the platform for mobile monitoring.
- Type a name for your mobile project, and select Continue.
Configure the Unity plugin
These procedures to configure your app also appear on the Get Started page in the New Relic UI.
NewRelic-Unity-Plugin.unitypackageinto your project by going to Assets > Import Package > Custom Package... and selecting
- Create a new
GameObjectin your project's initial scene by going to
GameObject > Create Emptyand name it NewRelicAgent.
NewRelicAgent.csscript (located in
Assets/Plugins) to the
NewRelicAgent GameObjectby dragging it on top of
NewRelicAgentin the Hierarchy tab. You can also click the Add Component button, and select New Relic Agent from the Scripts option.
- In the Inspector tab, set the iOS and Android Application Token from your New Relic Mobile apps. (New Relic recommends separate New Relic Mobile apps for separate platforms.)
- Build for your platform (iOS or Android) and open the resulting project (Xcode or Eclipse). You must import the generated Eclipse project into Android Studio.
Android only. Ensure that your app requests the
INTERNETpermission through the Player Settings inspector window. In Other Settings, Configuration, ensure Internet Access drop down is set to Required. This will result in the following permission added to the app's manifest:
<uses-permission android:name="android.permission.INTERNET" />
Run your app in an emulator or device to generate data.
Check New Relic Mobile to ensure the data is reporting to your account.
Configure crash reporting
The New Relic Unity plugin cannot automatically upload dSYMs for iOS Crash Reporting. You will need to manually upload dSYMs once your iOS unity app is built for release. If the application is
bitcode enabled, follow the instructions for bitcode enabled apps once the your iOS app is submitted to Apple.
If you are building an Android App with Proguard enabled, you must follow similar steps. The Proguard mapping needs to be uploaded to New Relic so crash reports can be de-obfuscated. For detailed information, see Android Agent Crash Reporting.
Changing the logging level (optional)
New Relic recommends setting the logging level from the Unity Inspector tab.
Six log levels are available for mobile apps monitoring:
For more help
Additional documentation resources include: