自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
创建 Cuttlefish 混合设备
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页介绍了如何创建 Cuttlefish 混合设备 (CHD)。
CHD 是一种混合虚拟 Cuttlefish 设备,可运行实体设备的系统映像,而不是设备 HAL 上的 Cuttlefish 系统映像。这类设备具有以下优势:
如要创建 CHD,请执行以下操作:
使用 make dist
为 Cuttlefish 设备和实体设备生成目标文件。
将这两个目标文件合并到一个 CHD 目标文件中,然后通过运行 build_cf_hybrid_device.py
脚本从 CHD 目标文件生成 CHD 映像:
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>
此脚本使用 merge_target_files.py
将这两个目标文件合并到一个 CHD 目标文件中,然后使用 img_from_target_files
从 CHD 目标文件生成 CHD 映像。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[null,null,["最后更新时间 (UTC):2025-03-26。"],[],[],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)."]]