A partir del 27 de marzo de 2025, te recomendamos que uses android-latest-release
en lugar de aosp-main
para compilar y contribuir a AOSP. Para obtener más información, consulta Cambios en AOSP.
Cómo desarrollar Kernels de Android
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En esta página, se describe cómo desarrollar kernels de Android en dispositivos Cuttlefish.
Manifiestos de kernels admitidos
Cuttlefish admite los siguientes manifiestos de kernels en la rama de la versión más reciente de Android y las versiones de GSI del AOSP.
- En
android-latest-release
- En
android-15.0.0_r36
common-android16-6.12
common-android15-6.6
common-android14-6.1
common-android14-5.15
- En
aosp-android13-gsi
common-android13-5.15
common-android13-5.10
- En
aosp-android12-gsi
common-android12-5.10
common-android12-5.4
common-android-4.19-stable
- En
aosp-android11-gsi
common-android11-5.4
common-android-4.19-stable
common-android-4.14-stable
Las siguientes son fuentes de kernels para el desarrollo de kernels en dispositivos Cuttlefish.
Cómo desarrollar Kernels de Android
Para desarrollar kernels en dispositivos Cuttlefish, sigue los pasos que aparecen a continuación:
Clona el manifiesto del repositorio de kernel correspondiente para tu dispositivo Cuttlefish y realiza cualquier cambio.
mkdir common-android-mainline
cd common-android-mainline
repo init -u https://android.googlesource.com/kernel/manifest -b common-android-mainline
repo sync -c -j$(nproc) -q
Compila el kernel y el ramdisk. Para obtener más información, consulta Cómo compilar módulos de proveedor para el dispositivo virtual.
tools/bazel run //common-modules/virtual-device:virtual_device_x86_64_dist
Si usas los manifiestos de kernel common-android-4.19-stable
, common-android-4.14-stable
, o common-android11-5.4
, ejecuta:
BUILD_CONFIG=common/build.config.gki.x86_64 build/build.sh && BUILD_CONFIG=common-modules/virtual-device/build.config.cuttlefish.x86_64 build/build.sh
En lugar de compilar de forma local (para evitar descargar la fuente del kernel y configurar su entorno de desarrollo), puedes descargar los artefactos relevantes desde ci.android.com.
Ejecuta el kernel y el ramdisk con Cuttlefish.
cvd create \
-kernel_path=./out/virtual_device_x86_64/dist/bzImage \
-initramfs_path=./out/virtual_device_x86_64/dist/initramfs.img
Si ejecutas un kernel que no es de GKI (cualquier versión igual o inferior a 4.19), omite el argumento -initramfs_path
.
Si ejecutas el kernel en una versión aarch64 de Cuttlefish, usa la configuración de compilación aarch64
y el artefacto Image
en lugar de bzImage
.
cvd create \
-kernel_path=./out/virtual_device_aarch64/dist/Image \
-initramfs_path=./out/virtual_device_aarch64/dist/initramfs.img
El contenido y las muestras de código que aparecen en esta página están sujetas a las licencias que se describen en la Licencia de Contenido. Java y OpenJDK son marcas registradas de Oracle o sus afiliados.
Última actualización: 2025-07-27 (UTC)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-07-27 (UTC)"],[],[],null,["# Develop Android kernels\n\n\u003cbr /\u003e\n\nThis page describes how to develop Android kernels on Cuttlefish devices.\n\nSupported kernel manifests\n--------------------------\n\nCuttlefish supports the following kernel manifests on\nthe Android latest release branch and AOSP GSI releases.\n\n- On `android-latest-release`\n - `common-android-mainline`\n- On `android-15.0.0_r36`\n - `common-android16-6.12`\n - `common-android15-6.6`\n - `common-android14-6.1`\n - `common-android14-5.15`\n- On `aosp-android13-gsi`\n - `common-android13-5.15`\n - `common-android13-5.10`\n- On `aosp-android12-gsi`\n - `common-android12-5.10`\n - `common-android12-5.4`\n - `common-android-4.19-stable`\n- On `aosp-android11-gsi`\n - `common-android11-5.4`\n - `common-android-4.19-stable`\n - `common-android-4.14-stable`\n\nThe following are kernel sources for kernel development on Cuttlefish devices.\n\n- [`kernel/common-android-mainline`](https://cs.android.com/android/kernel/superproject/+/common-android-mainline:)\n- [`kernel/common-android16-6.12`](https://cs.android.com/android/kernel/superproject/+/common-android16-6.12:)\n- [`kernel/common-android15-6.6`](https://cs.android.com/android/kernel/superproject/+/common-android15-6.6:)\n- [`kernel/common-android14-6.1`](https://cs.android.com/android/kernel/superproject/+/common-android14-6.1:)\n- [`kernel/common-android14-5.15`](https://cs.android.com/android/kernel/superproject/+/common-android14-5.15:)\n- [`kernel/common-android13-5.15`](https://cs.android.com/android/kernel/superproject/+/common-android13-5.15:)\n- [`kernel/common-android13-5.10`](https://cs.android.com/android/kernel/superproject/+/common-android13-5.10:)\n\nDevelop Android kernels\n-----------------------\n\nTo develop kernels on Cuttlefish devices, follow these steps:\n\n1. Clone the appropriate kernel repo manifest for your Cuttlefish device and\n make any changes.\n\n mkdir common-android-mainline\n cd common-android-mainline\n repo init -u https://android.googlesource.com/kernel/manifest -b common-android-mainline\n repo sync -c -j$(nproc) -q\n\n2. Build the kernel and ramdisk. For more information, see\n [Building the Vendor Modules for the Virtual Device](/docs/setup/build/building-kernels#building-gki-modules).\n\n tools/bazel run //common-modules/virtual-device:virtual_device_x86_64_dist\n\n If using `common-android-4.19-stable`, `common-android-4.14-stable`, or\n `common-android11-5.4` kernel manifests, run: \n\n BUILD_CONFIG=common/build.config.gki.x86_64 build/build.sh && BUILD_CONFIG=common-modules/virtual-device/build.config.cuttlefish.x86_64 build/build.sh\n\n Instead of building locally (to avoid downloading the kernel source,\n setting up a kernel development environment), you can download the relevant\n artifacts at ci.android.com.\n - [`android-mainline`](https://ci.android.com/builds/branches/aosp_kernel-common-android-mainline/grid?)\n - [`android16-6.12`](https://ci.android.com/builds/branches/aosp_kernel-common-android16-6.12/grid?)\n - [`android15-6.6`](https://ci.android.com/builds/branches/aosp_kernel-common-android15-6.6/grid?)\n - [`android14-6.1`](https://ci.android.com/builds/branches/aosp_kernel-common-android14-6.1/grid?)\n - [`android14-5.15`](https://ci.android.com/builds/branches/aosp_kernel-common-android14-5.15/grid?)\n - [`android13-5.15`](https://ci.android.com/builds/branches/aosp_kernel-common-android13-5.15/grid?)\n - [`android13-5.10`](https://ci.android.com/builds/branches/aosp_kernel-common-android13-5.10/grid?)\n - [`android12-5.10`](https://ci.android.com/builds/branches/aosp_kernel-common-android12-5.10/grid?)\n - [`android12-5.4`](https://ci.android.com/builds/branches/aosp_kernel-common-android12-5.4/grid?)\n - [`android11-5.4`](https://ci.android.com/builds/branches/aosp_kernel-common-android11-5.4/grid?)\n3. Launch the kernel and ramdisk with Cuttlefish.\n\n cvd create \\\n -kernel_path=./out/virtual_device_x86_64/dist/bzImage \\\n -initramfs_path=./out/virtual_device_x86_64/dist/initramfs.img\n\n If launching a non-GKI kernel (anything at or under\n 4.19), omit the `-initramfs_path` argument.\n\n If you're launching the kernel on an aarch64 version of Cuttlefish, use the\n `aarch64` build configuration and use the `Image` artifact instead of\n `bzImage`. \n\n cvd create \\\n -kernel_path=./out/virtual_device_aarch64/dist/Image \\\n -initramfs_path=./out/virtual_device_aarch64/dist/initramfs.img"]]