Disable or uninstall the Mobile React Native agent


Follow these procedures as appropriate to temporarily disable New Relic Mobile's React Native agent or to remove it completely from your mobile application.

Disable the agent

You may want to temporarily disable the agent; for example, to troubleshoot whether the agent is causing crashes or slowness, or to troubleshoot other problems in your application.

  • To disable the agent, remove or comment out any New Relic API calls.
  • To re-enable the agent, re-add or uncomment your New Relic API calls.

Uninstall the agent

The uninstall procedure removes the React Native agent and New Relic CLI.

  1. Ensure that all relevant development environments (Xcode, Android Studio, etc.) and the React Native Metro bundler are closed.

  2. From the root of your project, run the following commands. Replace YYYY-MM-DD and VERSION with your React Native agent release:

    npx newrelic-mobile-react-native remove --verbose
    npm uninstall newrelic-mobile-rn
    npm uninstall newrelic-mobile-cli
    rm newrelic.json
  3. Clean all build folders, and then restart.

For more help

During the public beta, we welcome your questions and comments through the React Native beta discussion board in New Relic's Explorers Hub. Support requests also will be routed there.