2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
Cuttlefish: 맞춤 기기 만들기
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 맞춤설정된 Cuttlefish 기기를 만드는 방법을 설명합니다. Cuttlefish에는 AndroidProducts.mk
에 나열된 다양한 폼 팩터로 사전 정의된 기기 유형이 포함되어 있습니다. 새 기기 추가에 설명된 일반적인 기기 맞춤설정 옵션 외에도 가상 기기 보드 구성 사전 설정 (vsoc_x86_64, vsoc_arm64, vsoc_riscv64), 커널 사전 빌드, 부트로더 사전 빌드, 공급업체 속성, 시스템 구성, 중첩 가상화 지원, 디스플레이 옵션과 같은 Cuttlefish별 맞춤설정을 할 수 있습니다. 맞춤설정할 수 있는 빌드 시간 매개변수의 전체 목록은 device/google/cuttlefish/vsoc_x86_64/phone/aosp_cf.mk
를 참고하세요.
다음 단계에서는 일반 Cuttlefish 기기보다 10배 큰 가상의 x86-64 big_phone
기기를 만드는 방법을 설명합니다.
기존 타겟에서 상속
기존 타겟에서 상속받으려면 다음을 실행하세요.
device/google/cuttlefish/vsoc_x86_64/big_phone
디렉터리를 만듭니다.
- 해당 디렉터리에서
aosp_cf.mk
파일을 만듭니다.
$(call inherit-product, device/google/cuttlefish/vsoc_x86_64_phone.mk)
PRODUCT_NAME: big_phone
PRODUCT_DEVICE: vsoc_x86_64
PRODUCT_MANUFACTURER := My Company
PRODUCT_MODEL: My Company very large phone
PRODUCT_VENDOR_PROPERTIES += \
ro.soc.manufacturer=$(PRODUCT_MANUFACTURER) \
ro.soc.model=$(PRODUCT_DEVICE)
lunch 타겟 추가
device/google/cuttlefish/AndroidProducts.mk
파일에 lunch
타겟을 삽입합니다.
PRODUCT_MAKEFILES := \
...
big_phone:$(LOCAL_DIR)/vsoc_x86_64/big_phone/aosp_cf.mk
...
lunch big_phone
JSON 구성 정의
Cuttlefish 기기를 실행하려면 계층 구조가 기기 속성을 나타내는 big_phone.json
이라는 JSON 구성 파일을 만듭니다. 예를 들어 JSON 구성 파일에서는 VM에 할당된 RAM과 디스플레이 구성 등의 옵션을 지정할 수 있습니다. 이 파일은 AOSP 트리에 없어도 됩니다.
구성의 JSON 형식에 관한 자세한 내용은 표준 구성을 참고하세요.
{
"instances":
[
{
"vm": {
"memory_mb": 40960,
},
"graphics": {
"displays": [
{
"width": 7200,
"height": 12800,
"dpi": 320
}
]
}
}
]
}
구성을 실행하려면 다음을 실행합니다.
cvd create --config_file=big_phone.json
launch_cvd(기존) 실행
특정 구성 속성은 계층적 JSON 구성 형식에서 사용할 수 없습니다. 이러한 구성의 경우에는 단일 수준 JSON 사전에서 launch_cvd
플래그 기본값을 설정할 수 있습니다. 모든 구성 옵션의 전체 목록은 cf_flags_validator.cpp
를 참고하세요.
다음은 JSON 구성 파일을 사용하여 launch_cvd
플래그 옵션의 기본값을 재정의하고 Cuttlefish 런처를 사용 설정하여 맞춤 구성을 실행하는 방법을 예를 들어 설명합니다.
맞춤 값을 사용하여 JSON 구성 파일 device/google/cuttlefish/shared/config/config_big_phone.json
을 만듭니다.
{
"x_res": 7200,
"y_res": 12800,
"dpi": 320,
"memory_mb": 40960,
"ddr_mem_mb": 49150,
}
Cuttlefish 런처에서 big_phone
구성을 실행하려면 다음을 실행하여 device/google/cuttlefish/shared/config/config_big_phone.json
파일에 액세스할 수 있어야 합니다.
device/google/cuttlefish/shared/config/Android.bp
파일에 prebuilt_etc_host
스탠자를 추가하여 JSON 아티팩트를 빌드 아티팩트로 선언합니다.
prebuilt_etc_host {
name: "cvd_config_big_phone.json",
src: "config_big_phone.json",
sub_dir: "cvd_config",
}
device/google/cuttlefish/shared/device.mk
에서 다음을 실행하여 결과 빌드 아티팩트 선언을 Cuttlefish 런처에 추가합니다.
$(call soong_config_append,cvd,launch_configs,cvd_config_big_phone)
android_info.txt
파일을 만들고 device/google/cuttlefish/vsoc_x86_64/big_phone/aosp_cf.mk
에 다음 줄을 추가하여 big_phone
구성을 파일에 연결합니다.
TARGET_BOARD_INFO_FILE := device/google/cuttlefish/vsoc_x86_64/<var>big_phone</var>/android-info.txt
다음과 같이 device/google/cuttlefish/vsoc_x86_64/big_phone/android-info.txt
를 채워 big_phone
구성으로 기기 유형에 라벨을 지정합니다.
config=big_phone
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 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,["# Cuttlefish: Create a custom device\n\nThis page describes how to create a customized Cuttlefish device. Cuttlefish\nincludes predefined device types in different form factors as listed in\n[`AndroidProducts.mk`](https://cs.android.com/android/platform/superproject/+/android-latest-release:device/google/cuttlefish/AndroidProducts.mk). In addition to the general device customization\noptions described in\n[Adding a new device](/docs/setup/create/new-device), you can make\nCuttlefish-specific customizations such as virtual device board\nconfiguration presets (vsoc_x86_64, vsoc_arm64, vsoc_riscv64), kernel prebuilts,\nbootloader prebuilts, vendor properties, system configurations, nested\nvirtualization support, and display options. For a full list of the\nbuild time parameters that can be customized, see\n[`device/google/cuttlefish/vsoc_x86_64/phone/aosp_cf.mk`](https://cs.android.com/android/platform/superproject/+/android-latest-release:device/google/cuttlefish/vsoc_x86_64/phone/aosp_cf.mk).\n\nThe following steps describe how to create a fictional x86-64\n\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e device ten times the size of an ordinary\nCuttlefish device.\n\nInherit from an existing target\n-------------------------------\n\nTo inherit from an existing target:\n\n- Create a `device/google/cuttlefish/vsoc_x86_64/`\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e directory.\n- Create an `aosp_cf.mk` file in that directory.\n\n $(call inherit-product, device/google/cuttlefish/vsoc_x86_64_phone.mk)\n\n PRODUCT_NAME: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ebig_phone\u003c/span\u003e\u003c/var\u003e\n PRODUCT_DEVICE: vsoc_x86_64\n PRODUCT_MANUFACTURER := \u003cvar translate=\"no\"\u003eMy\u003cspan class=\"devsite-syntax-w\"\u003e \u003c/span\u003eCompany\u003c/var\u003e\n PRODUCT_MODEL: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eMy\u003c/span\u003e \u003cspan class=\"devsite-syntax-n\"\u003eCompany\u003c/span\u003e \u003cspan class=\"devsite-syntax-n\"\u003every\u003c/span\u003e \u003cspan class=\"devsite-syntax-n\"\u003elarge\u003c/span\u003e \u003cspan class=\"devsite-syntax-n\"\u003ephone\u003c/span\u003e\u003c/var\u003e\n\n PRODUCT_VENDOR_PROPERTIES += \\\n ro.soc.manufacturer=$(PRODUCT_MANUFACTURER) \\\n ro.soc.model=$(PRODUCT_DEVICE)\n\nAdd a lunch target\n------------------\n\nInsert the `lunch` target into the\n`device/google/cuttlefish/AndroidProducts.mk` file: \n\n PRODUCT_MAKEFILES := \\\n ...\n \u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e:$(LOCAL_DIR)/vsoc_x86_64/\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e/aosp_cf.mk\n ...\n\n lunch \u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e\n\nDefine JSON configuration\n-------------------------\n\nTo launch the Cuttlefish device, create a JSON configuration file named\n\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e`.json` with a hierarchical structure representing\nthe device properties. For example, in the JSON configuration file, you can\nspecify options such as the RAM allocated for the VM and the display\nconfiguration. This file doesn't have to be in the AOSP tree.\nFor details on the JSON format for configurations, see\n[Canonical configurations](/docs/devices/cuttlefish/multi-tenancy#canonical-configs). \n\n {\n \"instances\":\n [\n {\n \"vm\": {\n \"memory_mb\": 40960,\n },\n \"graphics\": {\n \"displays\": [\n {\n \"width\": 7200,\n \"height\": 12800,\n \"dpi\": 320\n }\n ]\n }\n }\n ]\n }\n\nTo launch the configuration, run: \n\n cvd create --config_file=\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e.json\n\nRun launch_cvd (legacy)\n-----------------------\n\nCertain configuration properties aren't available in the hierarchical JSON\nconfiguration format. For such configurations, you can set `launch_cvd` flag\ndefault values from a single-level JSON dictionary. For a full list of all\nconfiguration options, see\n[`cf_flags_validator.cpp`](https://github.com/google/android-cuttlefish/blob/main/base/cvd/cuttlefish/host/commands/cvd/parser/cf_flags_validator.cpp).\n\nThe following describes an example of how to override the default values of the\n[`launch_cvd` flag options](/docs/devices/cuttlefish/restart#flags)\nusing a JSON configuration file and enable the Cuttlefish launcher to launch the\ncustom configuration.\n\n1. Create a JSON configuration file,\n `device/google/cuttlefish/shared/config/config_`\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e`.json`,\n with custom values.\n\n {\n \"x_res\": 7200,\n \"y_res\": 12800,\n \"dpi\": 320,\n \"memory_mb\": 40960,\n \"ddr_mem_mb\": 49150,\n }\n\n2. For the Cuttlefish launcher to launch the `big_phone` config, ensure it has\n access to the\n `device/google/cuttlefish/shared/config/config_`\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e`.json`\n file by doing the following:\n\n 1. Declare the JSON artifact as a build artifact by adding the\n `prebuilt_etc_host` stanza in the\n `device/google/cuttlefish/shared/config/Android.bp` file.\n\n prebuilt_etc_host {\n name: \"cvd_config_\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e.json\",\n src: \"config_\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e.json\",\n sub_dir: \"cvd_config\",\n }\n\n 2. Add the resulting build artifact declaration into the Cuttlefish\n launcher by running the following in\n `device/google/cuttlefish/shared/device.mk`.\n\n $(call soong_config_append,cvd,launch_configs,cvd_config_\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e)\n\n 3. Create an `android_info.txt` file and tie the `big_phone` config to the\n file by adding the following line to\n `device/google/cuttlefish/vsoc_x86_64/`\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e`/aosp_cf.mk`:\n\n TARGET_BOARD_INFO_FILE := device/google/cuttlefish/vsoc_x86_64/\u003cvar\u003ebig_phone\u003c/var\u003e/android-info.txt\n\n 4. Label the device type with the `big_phone` config by populating\n `device/google/cuttlefish/vsoc_x86_64/`\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e`/android-info.txt`\n with the following:\n\n config=\u003cvar translate=\"no\"\u003ebig_phone\u003c/var\u003e"]]