Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Gỡ lỗi VHAL
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Bạn có thể sử dụng các hướng dẫn sau để kết xuất thông tin gỡ lỗi VHAL. Thao tác này sẽ gọi phương thức dump()
trong giao diện VHAL. Phương thức này không được liệt kê trong giao diện nhưng được kế thừa ngầm cho tất cả các dịch vụ AIDL, với tất cả các đối số bổ sung được cung cấp trong lệnh.
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default
Sử dụng lệnh sau để liệt kê các lệnh gỡ lỗi được hỗ trợ cho VHAL tham chiếu:
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --help
Ví dụ: VHAL tham chiếu hỗ trợ đọc giá trị thuộc tính (chẳng hạn như INFO_VIN
) thông qua:
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --get INFO_VIN
hoặc
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --get 0x11100100
Để đặt giá trị thuộc tính, hãy sử dụng --set
, ví dụ: để đặt SEAT_MEMORY_SELECT
cho mã khu vực: ROW_1_LEFT
thành giá trị 1
:
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --set SEAT_MEMORY_SELECT -a ROW_1_LEFT -i 1
Đối với HIDL VHAL, hãy sử dụng:
adb root && adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default
Bạn cũng có thể sử dụng quy trình kiểm thử VTS, VtsHalAutomotiveVehicle_TargetTest
để xác minh cách triển khai VHAL. Trường hợp kiểm thử, useAidlBackend
hoặc
useHidlBackend
, sẽ bị bỏ qua nếu không có phần phụ trợ cụ thể. Bạn cũng có thể bỏ qua một số bài kiểm thử cho phần phụ trợ AIDL hoặc HIDL nếu phần phụ trợ không hỗ trợ tính năng này.
Quy trình kiểm thử VTS xác minh rằng tất cả các thuộc tính hệ thống được hỗ trợ đều có cấu hình chính xác. Công cụ này cũng xác minh các thao tác VHAL cơ bản cho các thuộc tính được hỗ trợ.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],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."]]