# React Native - Explaining npx instrumentdynatrace

**URL:** <https://community.dynatrace.com/t/react-native-explaining-npx-instrumentdynatrace/50890>\
**Category:** Dynatrace Tips\
**Tags:** react-native, mobile-monitoring, tips-and-tricks\
**Created:** [March 25, 2025, 6:32pm UTC](https://community.dynatrace.com/t/react-native-explaining-npx-instrumentdynatrace/50890 "2025-03-25T18:32:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaron\_Schultz](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aaron_schultz/32/38258_2.png) [@Aaron\_Schultz](https://community.dynatrace.com/u/Aaron_Schultz)\
**Post date:** [March 25, 2025, 6:32pm UTC](https://community.dynatrace.com/t/react-native-explaining-npx-instrumentdynatrace/50890/1 "2025-03-25T18:32:08Z")

</div>

# React Native - npx instrumentdynatrace

When using a React Native app, when first setting up Dynatrace for it, you’ll need to run:

```auto
npx instrumentdynatrace

```

This is not necessarily a one-and-done command.

## What does the command do and when to run it?

When running the command _npx instrumentdynatrace_, the command will take the configurations from **dynatrace.config.js** , takes each portion (iOS and Android), and copies it to the correct file in their respective OS folders.

You must run this command every time you make any changes to the **dynatrace.config.js**. Without using the command, changes will not take affect.

Once you have run the command, you can view the configuration from the **dynatrace.config.js** in its respective OS folder:

### For Android:

You should be able to see the changes in the dyantrace.gradle

_{project name}/node\_modules/@dynatrace/react-native-plugin/files/dynatrace.gradle_

 ![npxinstrumentdynatrace-1.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/782113d36cc009c3856fb0d36d15b18963cd9b5b.png)

### For iOS:

You should be able to see the change in the p.list.

_{project name}/ios/{project name}/Info.plist_

 ![npxinstrumentdynatrace-2.png](https://global.discourse-cdn.com/dynatrace/original/3X/f/3/f397a283c8a6f232fa4667d27e93c2640bbbb8d8.png)

Once the command _npx instrumentdynatrace_ has been ran, you can view the change from the terminal:

**If you made changes and it was successful:**

You should be able to see that for both OSs, that the configuration has been updates

**The green box for Android**

```auto
#INFO [2025-03-20 16:52:25]: Starting Android Instrumentation with Dynatrace!
#INFO [2025-03-20 16:52:25]: Dynatrace plugin & agent already added to build.gradle
#INFO [2025-03-20 16:52:25]: Replaced old configuration with current configuration in dynatrace.gradle
#INFO [2025-03-20 16:52:25]: Finished Android Instrumentation with Dynatrace!

```

**The blue box for iOS**

```auto
#INFO [2025-03-20 16:52:25]: Starting iOS Instrumentation with Dynatrace!
#INFO [2025-03-20 16:52:25]: Generating a new plist as the current plist and dynatrace.config.js iOS properties do not match!
#INFO [2025-03-20 16:52:25]: Removed old configuration in plist file: /Users/aaron.schultz/MyApplications/Mobile/React Native/ReactNativeSampleApp/ios/ReactNativeSampleApp/Info.plist
#INFO [2025-03-20 16:52:26]: Updated configuration in plist file: /Users/aaron.schultz/MyApplications/Mobile/React Native/ReactNativeSampleApp/ios/ReactNativeSampleApp/Info.plist

```

 ![npxinstrumentdynatrace-3.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/5/d5c71de023b6a84dbff1058018705699349fc995.png)

**If no changes were made to the dynatrace.config.js**

For Android, the gradle file will be written, but since nothing change, the output will be the same.

For iOS, the plugin is aware that the p.list is the same and does not make any further changes to the p.list

 ![npxinstrumentdynatrace-4.png](https://global.discourse-cdn.com/dynatrace/original/2X/2/23bc671b5383b829a77f8a305f8545542b3d9e76.png)
