This page describes how to run a monitoring app. This monitoring app acts as a
local server and displays the data that a Tuning Fork-enabled app
produces. You run the monitoring app alongside your own app to verify that it is
properly sending data.

## Enable a local endpoint in Unity

You need to configure your app to transmit data to a local endpoint on the
device rather than Google Play servers. To enable a local endpoint, call
[`EnableLocalEndpoint()`](https://developer.android.com/games/sdk/reference/performance-tuner/unity/class/google/android/performance-tuner/android-performance-tuner-t-fidelity-t-annotation-#enablelocalendpoint)
before calling `Start()` in your game code:  

    tuner.EnableLocalEndpoint();

Add a flag in your `AndroidManifest.xml` file:

1. Open the Unity build settings (**File \> Build Settings**).
2. If it's not selected yet, select the Android platform.
3. Select the **Export Project** checkbox. The next time you build the Unity project, it creates an Android project.
4. Build an Android project (**File \> Build and Run**).
5. Open the `AndroidManifest.xml` file and add the flag `android:usesCleartextTraffic="true"`:

    <application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      ...
      android:usesCleartextTraffic="true"
      ...

Now your game sends all requests to a local endpoint.

## Run your app and the monitor app

Follow these steps to run the Tuning Fork Monitor app and your app at the same time
to verify that your app is working properly:

1. Connect a device (or [create a virtual device](https://developer.android.com/studio/run/managing-avds)) to run the apps. Enable [developer options and USB debugging](https://developer.android.com/studio/debug/dev-options#enable) on the device.
2. Install the Tuning Fork Monitor app APK on the target device. You can build it from the [Tuning Fork Monitor source page](https://android.googlesource.com/platform/frameworks/opt/gamesdk/+/refs/heads/gamesdk-main/games-performance-tuner/tools/TuningForkMonitor/).
3. Press the Android Home button to send the Tuning Fork Monitor app to the background on the device.
4. Run your app in the foreground for about 30 seconds.
5. Switch back to the Tuning Fork Monitor app.
6. Your app's package name appears under **Live Applications**. Tap this entry to see app details and live telemetry.

![](https://developer.android.com/static/images/games/performance-tuner/monitor-app1.png) **Figure 1.** The monitor app detects the demo app  
![](https://developer.android.com/static/images/games/performance-tuner/monitor-app2.png) **Figure 2.** The monitor app displays data from the demo app