Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Saat memecahkan masalah perilaku runtime dan performa di Android
Anda dapat mencatat panggilan API ARCore ke
Log perangkat Android.
Jika Anda mengaktifkan logging panggilan, ARCore akan mencatat semua panggilan API dengan C API-nya.
terlepas dari SDK yang digunakan untuk membuat aplikasi tersebut. Semua nama API C dapat
dapat ditemukan di dokumentasi referensi API C, beserta
parameternya dan nilai yang ditampilkan.
Mengaktifkan logging panggilan API
Panggilan API ARCore yang tidak menggunakan parameter ArSession* seperti *_destroy
dan fungsi *_release tidak dicatat.
Ikuti langkah-langkah berikut untuk mengaktifkan logging panggilan API ARCore.
Pastikan Layanan Google Play untuk AR (ARCore) 1.23 atau yang lebih baru telah diinstal:
Buka pengalaman AR di aplikasi Anda agar ada sesi ARCore yang aktif
sedang berjalan. Aplikasi Anda harus berada dalam mode AR agar dapat menerima siaran yang memungkinkan
. Gambar pratinjau kamera AR harus terlihat di perangkat
layar.
Gunakan perintah siaran pengelola aktivitas berikut untuk mengaktifkan logging panggilan:
untuk aplikasi Anda.
# 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
Menonaktifkan logging panggilan API
Ikuti langkah-langkah ini untuk menonaktifkan logging panggilan API ARCore.
Buka pengalaman AR di aplikasi Anda agar ada sesi ARCore yang aktif
sedang berjalan. Aplikasi Anda harus berada dalam mode AR untuk menerima siaran yang dinonaktifkan
. Gambar pratinjau kamera AR harus terlihat di perangkat
layar.
Gunakan perintah siaran pengelola aktivitas berikut untuk menonaktifkan logging panggilan
untuk aplikasi Anda:
# 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
Melihat output
ARCore menggunakan tag ARCore-Api untuk semua output logging ARCore API. Gunakan
perintah berikut untuk memfilter hanya panggilan tersebut.
# 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
Kapasitas ARCore membatasi output untuk mengurangi spam log. Ini menggabungkan log yang dilewati
menjadi satu pesan log.
Contoh output pesan log yang dilewati:
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,["Terakhir diperbarui pada 2025-07-26 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)"]]