ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
สร้างอุปกรณ์แบบผสม Cuttlefish
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หน้านี้จะอธิบายวิธีสร้างอุปกรณ์แบบผสม Cuttlefish (CHD)
CHD เป็นอุปกรณ์ Cuttlefish เสมือนแบบผสม ซึ่งจะเรียกใช้อิมเมจระบบของอุปกรณ์จริงแทนอิมเมจระบบ Cuttlefish ใน HAL ของอุปกรณ์ ซึ่งมีข้อดีดังต่อไปนี้
การพัฒนาและการทดสอบขั้นต้น: CHD ช่วยในการพัฒนาและการทดสอบซอฟต์แวร์ระบบรุ่นถัดไปตั้งแต่เนิ่นๆ ก่อนที่ฮาร์ดแวร์จริงจะพร้อมใช้งาน
ความสามารถในการปรับขนาด: CHD ช่วยขยายขีดความสามารถในการพัฒนาและการทดสอบได้ง่ายขึ้น
วิธีสร้าง CHD มีดังนี้
สร้างไฟล์เป้าหมายสำหรับอุปกรณ์ Cuttlefish และอุปกรณ์จริงโดยใช้ make dist
รวมไฟล์เป้าหมาย 2 ไฟล์เป็นไฟล์เป้าหมาย CHD และสร้างรูปภาพ CHD จากไฟล์เป้าหมาย CHD โดยเรียกใช้สคริปต์ 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>
สคริปต์นี้จะรวมไฟล์เป้าหมาย 2 ไฟล์เข้าเป็นไฟล์เป้าหมาย CHD โดยใช้ merge_target_files.py
และสร้างรูปภาพ CHD จากไฟล์เป้าหมาย CHD โดยใช้ img_from_target_files
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 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)."]]