Google is committed to advancing racial equity for Black communities. See how.

Performance overlay for Unity

ARCore can display an overlay panel with an app’s performance statistics such as CPU and memory usage, providing a real-time overview of system resources.

Enable the performance overlay

Follow these steps to enable the performance overlay.

  1. Open the AR experience in your app so that there is an active ARCore session running. Your app must be in AR mode to receive the broadcast that enables the overlay. The AR camera preview images should be visible on the device screen.

  2. Use the following activity manager broadcast command to enable the performance overlay for your app.

    # Enables ARCore's performance overlay and saves a setting to your app's
    # Android Shared Preferences, so that the overlay remains enabled in
    # subsequent ARCore sessions.
    
    # Your app must have an actively running ARCore session to receive the broadcast.
    adb shell am broadcast -a com.google.ar.core.ENABLE_PERFORMANCE_OVERLAY
    
  3. You may be directed to the Settings menu to grant the ARCore package permission to draw overlays. This step only needs to be performed once. Find Google Play Services for AR and set the permissions toggle to Allowed before navigating back to your app.

    If you have enabled the performance overlay without granting ARCore permission to draw overlays, you will be directed to the Settings menu each time the app begins a new ARCore session. In this case, you should either grant ARCore permission, or disable the performance overlay.

Disable the performance overlay

Follow these steps to disable the performance overlay.

  1. Open the AR experience in your app so that there is an active ARCore session running. Your app must be in AR mode to receive the broadcast that disables the overlay. The AR camera preview images should be visible on the device screen.

  2. Use the following activity manager broadcast command to disable the performance overlay for your app.

    # Disables ARCore's performance overlay and saves a setting to your app's
    # Android Shared Preferences, so that the overlay remains disabled in
    # subsequent ARCore sessions.
    
    # Your app must have an actively running ARCore session to receive the broadcast.
    adb shell am broadcast -a com.google.ar.core.DISABLE_PERFORMANCE_OVERLAY
    

You can also disable the performance overlay by tapping the close button on the overlay and clearing your app’s Android Shared Preferences. One way to do this is to clear your app’s data.

Interpreting CPU usage values

The Process CPU Usage field displays the amount of CPU time that the application process currently uses as a percentage of the device’s total available CPU time. This value includes application workloads, ARCore workloads, and any other libraries that your app uses. For example, the field would display 25% CPU usage if the application process fully saturates a single CPU core when running on a quad-core device.

The performance overlay also provides a CPU usage breakdown for individual ARCore features. These breakdowns are also expressed as a percentage of the device’s total available CPU time. The workloads are:

The overlay does not display any features that are disabled or using less than 0.1% CPU time.