在您的应用中打开 AR 体验,以便存在进行中的 ARCore 会话
。您的应用必须在 AR 模式下才能接收启用 AR 功能的广播
日志记录AR 相机预览图片应该在设备上可见
屏幕。
使用以下 activity 管理器广播命令启用通话记录:
。
# 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
停用 API 调用日志记录
请按照以下步骤停用 ARCore API 通话记录。
在您的应用中打开 AR 体验,以便存在进行中的 ARCore 会话
。您的应用必须在 AR 模式下才能接收会停用 AR 功能的广播
日志记录AR 相机预览图片应该在设备上可见
屏幕。
使用以下 activity 管理器广播命令停用通话记录
:
# 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
查看输出
ARCore 对所有 ARCore API 日志记录输出使用 ARCore-Api 标记。使用
以仅过滤这些调用。
# 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 速率限制输出以减少垃圾日志。汇总跳过的日志
转换为单个日志消息。
跳过的日志消息的输出示例:
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)
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\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)"]]