自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
调试 VHAL
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
您可以按照以下说明转储 VHAL 调试信息。这会调用 VHAL 接口中的 dump()
方法,该方法并未在接口中列出,但对所有 AIDL 服务来说是隐式继承的,并包含命令中提供的所有附加参数。
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default
可以使用以下命令列出参考 VHAL 支持的调试命令:
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --help
例如,参考 VHAL 支持通过以下命令读取属性值(如 INFO_VIN
):
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --get 0x11100100
对于 HIDL VHAL,请使用:
adb root && adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default
您还可以使用 VTS 测试 VtsHalAutomotiveVehicle_TargetTest
来验证您的 VHAL 实现。如果特定后端不可用,系统会跳过测试用例 useAidlBackend
或 useHidlBackend
。如果 AIDL 或 HIDL 后端不支持此功能,系统也可跳过某些测试。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[null,null,["最后更新时间 (UTC):2025-03-26。"],[],[],null,["# Debug VHAL\n\nYou can use the following instructions to dump VHAL debug information. This calls the\n`dump()` method in the VHAL interface, which isn't listed in the interface but is\nimplicitly inherited for all AIDL services, with all the additional arguments provided in the\ncommand. \n\n```\nadb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default\n```\n\nUse the following command to list the supported debug commands for the reference VHAL: \n\n```\nadb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --help\n```\n\nFor example, the reference VHAL supports reading a property value\n(such as `INFO_VIN`) through: \n\n```\nadb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --get INFO_VIN\n```\nor \n\n```\nadb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --get 0x11100100\n```\n\nTo set a property value, use `--set`, for example, to set `SEAT_MEMORY_SELECT`\nfor the area ID: `ROW_1_LEFT` to value `1`: \n\n```\nadb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --set SEAT_MEMORY_SELECT -a ROW_1_LEFT -i 1\n```\n\nFor the HIDL VHAL, use: \n\n```\nadb root && adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default\n```\n\nYou can also use the VTS test,\n[`VtsHalAutomotiveVehicle_TargetTest`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp),\nto verify your VHAL implementation. Either test case, `useAidlBackend` or\n`useHidlBackend`, is skipped if the specific backend isn't available. Some tests\ncan also be skipped for the AIDL or HIDL backend if the backend doesn't support this feature.\n\nThe VTS test verifies all supported system properties has correct configurations. It also\nverifies basic VHAL operations for supported properties."]]