Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina descrive come eseguire un'app di monitoraggio. Questa app di monitoraggio funge da
server locale e mostra i dati prodotti da un'app abilitata per Tuning Fork. Esegui l'app di monitoraggio insieme alla tua app per verificare che invii correttamente i dati.
Abilitare un endpoint locale in Unity
Devi configurare la tua app per trasmettere i dati a un endpoint locale sul
dispositivo anziché ai server di Google Play. Per attivare un endpoint locale, chiama
EnableLocalEndpoint()
prima di chiamare Start() nel codice del gioco:
tuner.EnableLocalEndpoint();
Aggiungi un flag nel file AndroidManifest.xml:
Apri le impostazioni di build di Unity (File > Build Settings).
Se non è ancora selezionata, seleziona la piattaforma Android.
Seleziona la casella di controllo Esporta progetto. La volta successiva che crei il progetto Unity, viene creato un progetto Android.
Crea un progetto Android (File > Build and Run).
Apri il file AndroidManifest.xml e aggiungi il flag
android:usesCleartextTraffic="true":
Premi il pulsante Home di Android per inviare l'app Tuning Fork Monitor in background sul dispositivo.
Esegui l'app in primo piano per circa 30 secondi.
Torna all'app Tuning Fork Monitor.
Il nome del pacchetto dell'app viene visualizzato nella sezione Live Applications (Applicazioni live). Tocca questa voce
per visualizzare i dettagli dell'app e la telemetria in tempo reale.
Figura 1. L'app di monitoraggio rileva l'app demo
Figura 2. L'app di monitoraggio mostra i dati dell'app demo
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-08-26 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-26 UTC."],[],[],null,["This page describes how to run a monitoring app. This monitoring app acts as a\nlocal server and displays the data that a Tuning Fork-enabled app\nproduces. You run the monitoring app alongside your own app to verify that it is\nproperly sending data.\n\nEnable a local endpoint in Unity\n\nYou need to configure your app to transmit data to a local endpoint on the\ndevice rather than Google Play servers. To enable a local endpoint, call\n[`EnableLocalEndpoint()`](/games/sdk/reference/performance-tuner/unity/class/google/android/performance-tuner/android-performance-tuner-t-fidelity-t-annotation-#enablelocalendpoint)\nbefore calling `Start()` in your game code: \n\n tuner.EnableLocalEndpoint();\n\nAdd a flag in your `AndroidManifest.xml` file:\n\n1. Open the Unity build settings (**File \\\u003e Build Settings**).\n2. If it's not selected yet, select the Android platform.\n3. Select the **Export Project** checkbox. The next time you build the Unity project, it creates an Android project.\n4. Build an Android project (**File \\\u003e Build and Run**).\n5. Open the `AndroidManifest.xml` file and add the flag `android:usesCleartextTraffic=\"true\"`:\n\n \u003capplication\n android:allowBackup=\"true\"\n android:icon=\"@mipmap/ic_launcher\"\n ...\n android:usesCleartextTraffic=\"true\"\n ...\n\nNow your game sends all requests to a local endpoint.\n\nRun your app and the monitor app\n\nFollow these steps to run the Tuning Fork Monitor app and your app at the same time\nto verify that your app is working properly:\n\n1. Connect a device (or [create a virtual device](/studio/run/managing-avds)) to run the apps. Enable [developer options and USB debugging](/studio/debug/dev-options#enable) on the device.\n2. 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/).\n3. Press the Android Home button to send the Tuning Fork Monitor app to the background on the device.\n4. Run your app in the foreground for about 30 seconds.\n5. Switch back to the Tuning Fork Monitor app.\n6. Your app's package name appears under **Live Applications**. Tap this entry to see app details and live telemetry.\n\n**Figure 1.** The monitor app detects the demo app \n**Figure 2.** The monitor app displays data from the demo app"]]