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.
Tạo thiết bị kết hợp Cuttlefish
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.
Trang này mô tả cách tạo thiết bị lai Cuttlefish (CHD).
CHD là một thiết bị Cuttlefish ảo kết hợp, chạy hình ảnh hệ thống của thiết bị thực thay vì hình ảnh hệ thống Cuttlefish trên HAL của thiết bị. Điều này mang lại các lợi ích sau:
Phát triển và thử nghiệm sớm: CHD cho phép phát triển và thử nghiệm sớm phần mềm hệ thống thế hệ mới trước khi có phần cứng thực.
Khả năng mở rộng: CHD giúp mở rộng quy mô phát triển và thử nghiệm dễ dàng hơn.
Để tạo CHD, hãy làm như sau:
Tạo tệp mục tiêu cho thiết bị Cuttlefish và thiết bị thực bằng make dist
.
Kết hợp hai tệp mục tiêu thành một tệp mục tiêu CHD và tạo hình ảnh CHD từ tệp mục tiêu CHD bằng cách chạy tập lệnh build_cf_hybrid_device.py
:
python3 tools/treble/cuttlefish/build_cf_hybrid_device.py \
--framework_target_files_zip <physical_device_target_files.zip> \
--vendor_target_files_zip <cuttlefish_device_target_files.zip> \
--otatools_zip <cuttlefish_otatools.zip> \
--target chd \
--output_dir <output_directory>
Tập lệnh này kết hợp hai tệp mục tiêu thành một tệp mục tiêu CHD bằng cách sử dụng merge_target_files.py
và tạo hình ảnh CHD từ tệp mục tiêu CHD bằng cách sử dụng img_from_target_files
.
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-27 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-27 UTC."],[],[],null,["# Create a Cuttlefish hybrid device\n\nThis page describes how to create a Cuttlefish hybrid device (CHD).\n\nA CHD is a hybrid virtual Cuttlefish device, which runs a physical device's\nsystem image instead of a Cuttlefish system image on the device's HALs. This\noffers the following advantages:\n\n- **Early development and testing:** CHDs allow for early development and\n testing of next-generation system software before the physical hardware is\n available.\n\n- **Scalability:** CHDs facilitate easier expansion of development and\n testing capacity.\n\nTo create a CHD, do the following:\n\n1. Generate the target files for the Cuttlefish device and the physical device\n using `make dist`.\n\n2. Combine the two target files into a CHD target file and generate the CHD\n images from the CHD target file by running the\n [`build_cf_hybrid_device.py`](https://cs.android.com/android/platform/superproject/+/android-latest-release:tools/treble/cuttlefish/build_cf_hybrid_device.py)\n script:\n\n python3 tools/treble/cuttlefish/build_cf_hybrid_device.py \\\n --framework_target_files_zip \u003cphysical_device_target_files.zip\u003e \\\n --vendor_target_files_zip \u003ccuttlefish_device_target_files.zip\u003e \\\n --otatools_zip \u003ccuttlefish_otatools.zip\u003e \\\n --target chd \\\n --output_dir \u003coutput_directory\u003e\n\n This script combines the two target files into a CHD target file using\n [`merge_target_files.py`](https://cs.android.com/android/platform/superproject/+/android-latest-release:build/make/tools/releasetools/merge/merge_target_files.py)\n and generates the CHD images from the CHD target file using\n [`img_from_target_files`](https://cs.android.com/android/platform/superproject/+/android-latest-release:build/make/tools/releasetools/img_from_target_files.py)."]]