This page describes how to create a Cuttlefish hybrid device (CHD).
A CHD is a hybrid virtual Cuttlefish device, which runs a physical device's system image instead of a Cuttlefish system image on the device's HALs. This offers the following advantages:
Early development and testing: CHDs allow for early development and testing of next-generation system software before the physical hardware is available.
Scalability: CHDs facilitate easier expansion of development and testing capacity.
Create a CHD image
To create a CHD image, follow these steps:
Generate the target files for the vendor target and the physical device using
make dist. Generate the vendor target files using one of the following options:- An existing full Cuttlefish target
- A Cuttlefish target that builds only Cuttlefish vendor files. For more information, see Create a Cuttlefish vendor target.
Combine the two target files into a CHD target file and generate the CHD images from the CHD target file by running the
build_cf_hybrid_device.pyscript. This script combines the two target files into a CHD target file usingmerge_target_files.pyand generates the CHD images from the CHD target file usingimg_from_target_files.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>
Create a Cuttlefish vendor target
To create a Cuttlefish vendor-only target, follow these steps:
You can use aosp_cf_vendor.mk to define the
aosp_cf_arm64_phone_vendor target, which you can use as the vendor target
file for a CHD image.
Inherit the Cuttlefish target that builds full artifacts.
$(call inherit-product, device/google/cuttlefish/vsoc_arm64/phone/aosp_cf.mk)Define the target name.
PRODUCT_NAME := aosp_cf_arm64_phone_vendorDisable unnecessary builds from the full artifacts.
PRODUCT_BUILD_SYSTEM_IMAGE := false PRODUCT_BUILD_SYSTEM_OTHER_IMAGE := false PRODUCT_BUILD_PRODUCT_IMAGE := false PRODUCT_BUILD_SYSTEM_EXT_IMAGE := false PRODUCT_BUILD_SUPER_PARTITION := false TARGET_SKIP_OTA_PACKAGE := true