Stay organized with collections
Save and categorize content based on your preferences.
When troubleshooting runtime behavior and performance issues in your Android
app, you can log ARCore API calls to the
Android device log.
When you enable call logging, ARCore will log all API calls with their C API
name, regardless of the SDK that the app was built with. All C API names can
be found in the C API reference documentation, along with
their parameters and return values.
Enable API call logging
ARCore API calls that do not take ArSession* parameters such as *_destroy
and *_release functions are not logged.
Follow these steps to enable ARCore API call logging.
Ensure that Google Play Services for AR (ARCore) 1.23 or later is installed:
On Windows, run adb shell pm dump com.google.ar.core | findstr /i "packages: versionName".
On macOS, run adb shell pm dump com.google.ar.core | egrep -i versionName\|packages:.
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
logging. The AR camera preview images should be visible on the device
screen.
Use the following activity manager broadcast command to enable call logging:
for your app.
# Enables ARCore call logging and saves a setting to your app's# Android Shared Preferences, so that call logging 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_API_CALL_LOGGING
Disable API call logging
Follow these steps to disable ARCore API call logging.
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
logging. The AR camera preview images should be visible on the device
screen.
Use the following activity manager broadcast command to disable call logging
for your app:
# Disables ARCore call logging and saves a setting to your app's# Android Shared Preferences, so that call logging 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_API_CALL_LOGGING
Viewing the output
ARCore uses the ARCore-Api tag for all ARCore API logging output. Use the
following command to filter only those calls.
# Currently, ARCore only logs API calls that take an `ArSession*` argument.# Functions that do not take session parameters such as `*_destroy` and `*_release` are not logged.# -s is equivalent to the filter expression '*:S', which sets priority for all tags to silent.adb logcat -s ARCore-Api
ARCore rate-limits the output to reduce log spam. It aggregates skipped log
messages into a single log message.
Example output of skipped log messages:
D ARCore-Api: ArFrame_create(<ptr>)
D ARCore-Api: ArSession_update(<ptr>) -> AR_SUCCESS
D ARCore-Api: ArFrame_acquireCamera(<ptr>, <ptr>)
D ARCore-Api: ArFrame_getDisplayGeometryChanged(<ptr>, <ptr>)
D ARCore-Api: ArCamera_getTrackingFailureReason(<ptr>, <ptr>)
D ARCore-Api: ArFrame_getTimestamp(<ptr>, <ptr>)
D ARCore-Api: ArSession_setDisplayGeometry(0, 1080, 2195)
D ARCore-Api: ArFrame_create(<ptr>) (suppressing for 10s)
D ARCore-Api: ArSession_update(<ptr>) -> AR_SUCCESS (suppressing for 10s)
D ARCore-Api: ArFrame_acquireCamera(<ptr>, <ptr>) (suppressing for 10s)
D ARCore-Api: ArFrame_getDisplayGeometryChanged(<ptr>, <ptr>) (suppressing for 10s)
D ARCore-Api: ArCamera_getTrackingFailureReason(<ptr>, <ptr>) (suppressing for 10s)
D ARCore-Api: ArFrame_getTimestamp(<ptr>, <ptr>) (suppressing for 10s)
D ARCore-Api: ArSession_setDisplayGeometry(0, 1080, 2195) (suppressing for 10s)
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003eARCore API calls can be logged to the Android device log for troubleshooting runtime behavior and performance issues.\u003c/p\u003e\n"],["\u003cp\u003eEnable logging using an activity manager broadcast command while your app is in AR mode with an active session.\u003c/p\u003e\n"],["\u003cp\u003eAPI call logging includes C API names, parameters, and return values, but currently only for calls with an \u003ccode\u003eArSession*\u003c/code\u003e argument.\u003c/p\u003e\n"],["\u003cp\u003eView the logged output by filtering the device log for the \u003ccode\u003eARCore-Api\u003c/code\u003e tag.\u003c/p\u003e\n"],["\u003cp\u003eDisable logging by clearing your app's data or using a corresponding broadcast command while in AR mode.\u003c/p\u003e\n"]]],[],null,["# ARCore call logging\n\nWhen troubleshooting runtime behavior and performance issues in your Android\napp, you can log ARCore API calls to the\n[Android device log](https://developer.android.com/studio/command-line/logcat).\n\n**When you enable call logging, ARCore will log all API calls with their C API\nname, regardless of the SDK that the app was built with.** All C API names can\nbe found in the [C API reference documentation](/ar/reference/c), along with\ntheir parameters and return values.\n\nEnable API call logging\n-----------------------\n\n| **Key Point:** Currently, ARCore only logs API calls that in the ARCore SDK for Android (NDK) take an `ArSession*` argument.\n\nARCore API calls that do not take `ArSession*` parameters such as `*_destroy`\nand `*_release` functions are not logged.\n\nFollow these steps to enable ARCore API call logging.\n\n1. Ensure that Google Play Services for AR (ARCore) 1.23 or later is installed:\n\n - On Windows, run `adb shell pm dump com.google.ar.core | findstr /i \"packages: versionName\"`.\n - On macOS, run `adb shell pm dump com.google.ar.core | egrep -i versionName\\|packages:`.\n2. Open the AR experience in your app so that there is an active ARCore session\n running. **Your app must be in AR mode to receive the broadcast that enables\n logging.** The AR camera preview images should be visible on the device\n screen.\n\n3. Use the following activity manager broadcast command to enable call logging:\n for your app.\n\n # Enables ARCore call logging and saves a setting to your app's\n # Android Shared Preferences, so that call logging remains enabled in\n # subsequent ARCore sessions.\n\n # Your app must have an actively running ARCore session to receive the broadcast.\n adb shell am broadcast -a com.google.ar.core.ENABLE_API_CALL_LOGGING\n\nDisable API call logging\n------------------------\n\n| **Key Point:** You can also disable API call logging by clearing your app's Android Shared Preferences. One way to do this is to clear your app's data.\n\nFollow these steps to disable ARCore API call logging.\n\n1. Open the AR experience in your app so that there is an active ARCore session\n running. **Your app must be in AR mode to receive the broadcast that disables\n logging.** The AR camera preview images should be visible on the device\n screen.\n\n2. Use the following activity manager broadcast command to disable call logging\n for your app:\n\n # Disables ARCore call logging and saves a setting to your app's\n # Android Shared Preferences, so that call logging remains disabled in\n # subsequent ARCore sessions.\n\n # Your app must have an actively running ARCore session to receive the broadcast.\n adb shell am broadcast -a com.google.ar.core.DISABLE_API_CALL_LOGGING\n\nViewing the output\n------------------\n\nARCore uses the `ARCore-Api` tag for all ARCore API logging output. Use the\nfollowing command to filter only those calls. \n\n # Currently, ARCore only logs API calls that take an `ArSession*` argument.\n # Functions that do not take session parameters such as `*_destroy` and `*_release` are not logged.\n # -s is equivalent to the filter expression '*:S', which sets priority for all tags to silent.\n\n adb logcat -s ARCore-Api\n\nARCore rate-limits the output to reduce log spam. It aggregates skipped log\nmessages into a single log message.\n\nExample output of skipped log messages: \n\n D ARCore-Api: ArFrame_create(\u003cptr\u003e)\n D ARCore-Api: ArSession_update(\u003cptr\u003e) -\u003e AR_SUCCESS\n D ARCore-Api: ArFrame_acquireCamera(\u003cptr\u003e, \u003cptr\u003e)\n D ARCore-Api: ArFrame_getDisplayGeometryChanged(\u003cptr\u003e, \u003cptr\u003e)\n D ARCore-Api: ArCamera_getTrackingFailureReason(\u003cptr\u003e, \u003cptr\u003e)\n D ARCore-Api: ArFrame_getTimestamp(\u003cptr\u003e, \u003cptr\u003e)\n D ARCore-Api: ArSession_setDisplayGeometry(0, 1080, 2195)\n D ARCore-Api: ArFrame_create(\u003cptr\u003e) (suppressing for 10s)\n D ARCore-Api: ArSession_update(\u003cptr\u003e) -\u003e AR_SUCCESS (suppressing for 10s)\n D ARCore-Api: ArFrame_acquireCamera(\u003cptr\u003e, \u003cptr\u003e) (suppressing for 10s)\n D ARCore-Api: ArFrame_getDisplayGeometryChanged(\u003cptr\u003e, \u003cptr\u003e) (suppressing for 10s)\n D ARCore-Api: ArCamera_getTrackingFailureReason(\u003cptr\u003e, \u003cptr\u003e) (suppressing for 10s)\n D ARCore-Api: ArFrame_getTimestamp(\u003cptr\u003e, \u003cptr\u003e) (suppressing for 10s)\n D ARCore-Api: ArSession_setDisplayGeometry(0, 1080, 2195) (suppressing for 10s)"]]