À partir du 27 mars 2025, nous vous recommandons d'utiliser android-latest-release au lieu de aosp-main pour créer et contribuer à AOSP. Pour en savoir plus, consultez la section Modifications apportées à AOSP.
Le dépôt AOSP ne contient pas les images du fournisseur, qui sont nécessaires pour démarrer l'appareil. Vous pouvez télécharger les images sur ci.android.com:
Sélectionnez une version en surbrillance verte qui correspond à votre appareil:
Sur le Pixel 8 Pro, cliquez sur aosp_husky_pgagnostic.
Pour le Pixel 8, cliquez sur aosp_shiba_pgagnostic.
Pour le Pixel 8a, cliquez sur aosp_akita_16k.
L'onglet Artefacts (Artefacts) s'affiche en bas de la page.
Cliquez sur Artefacts. Les artefacts de votre appareil sont listés.
Pour télécharger l'artefact, cliquez sur le fichier se terminant par .sh.
Dans le répertoire où le fichier a été téléchargé, exécutez la commande suivante pour en extraire le contenu:
$cd~/Downloads
$chmod+xaosp_<selectedtarget>-flashable-<buildid>-with-license.sh
./aosp_<selectedtarget>-flashable-<buildid>-with-license.sh
# After reading the license, type
Type"I ACCEPT"ifyouagreetothetermsofthelicense:IACCEPT
# The extracted file will be in the current directory$ls
aosp_<selected_target>-flashable-with-license.zip
# unzip that file in a directory named aosp_vendor$unzipaosp_<selected_target>-flashable-with-license.zip-daosp_vendor
# The content of the directory will look like:$lsaosp_vendor
android-info.txtinit_boot.imgsuper_empty.imgsystem_other.imgvbmeta_vendor.imgvendor_kernel_boot.img
boot.imgproduct.imgsystem_dlkm.imguserdata.imgvendor_boot.img
bootloader.imgpvmfw.imgsystem_ext.imgvbmeta.imgvendor_dlkm.img
dtbo.imgradio.imgsystem.imgvbmeta_system.imgvendor.img
Copier les images dans un répertoire temporaire
Copiez les images AOSP, du kernel et du fournisseur dans un répertoire dans l'ordre suivant:
$fastbootrebootbootloader# Wipe out /data partition$fastboot-w# Disable pkvm$fastbootoempkvmdisable$fastbootflashboot$IMGS_DIR/boot.img$fastbootflashinit_boot$IMGS_DIR/init_boot.img$fastbootflashdtbo$IMGS_DIR/dtbo.img$fastbootflashvendor_kernel_boot$IMGS_DIR/vendor_kernel_boot.img$fastbootflashpvmfw$IMGS_DIR/pvmfw.img$fastbootflashvendor_boot$IMGS_DIR/vendor_boot.img$fastbootflash--disable-verity--disable-verificationvbmeta$IMGS_DIR/vbmeta.img$fastbootflash--disable-verity--disable-verificationvbmeta_system$IMGS_DIR/vbmeta_system.img$fastbootflash--disable-verity--disable-verificationvbmeta_vendor$IMGS_DIR/vbmeta_vendor.img
Appuyez sur le bouton Marche/Arrêt pour démarrer l'appareil.
Vérifiez la taille de la page avec:
$adbshellgetconfPAGE_SIZE
16384
Le contenu et les exemples de code de cette page sont soumis aux licences décrites dans la Licence de contenu. Java et OpenJDK sont des marques ou des marques déposées d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/27 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/27 (UTC)."],[],[],null,["# Build and flash Pixel 8 devices with 16 KB support\n\nThis page shows how to build Pixel 8, Pixel 8 Pro, and Pixel 8a with\n16 KB support.\n\nSync and build AOSP\n-------------------\n\nTo sync and build AOSP:\n\n1. Check out the AOSP repository:\n\n $ mkdir ~/aosp_main && cd ~/aosp_main\n $ repo init -u https://android.googlesource.com/platform/manifest -b main\n $ repo sync -c -j$(nproc)\n\n2. Source the `envsetup.sh` script to set up your build environment:\n\n $ source build/envsetup.sh\n\n3. Choose one of the three targets for Pixel 8 devices:\n\n - `aosp_husky_pgagnostic-trunk_staging-userdebug` for Pixel 8 Pro\n - `aosp_shiba_pgagnostic-trunk_staging-userdebug` for Pixel 8\n - `aosp_akita_16k-trunk_staging-userdebug` for Pixel 8a\n\n **Note:** The suffix `_pgagnostic` was used in the first 16 KB targets. The newest targets use the `_16k` suffix. \n\n $ lunch \u003cvar translate=\"no\"\u003etarget\u003c/var\u003e\n\n4. Build the code:\n\n $ m -j$(nproc)\n\n These images are generated after the build is finished: \n\n $ ls out/target/product/\u003chusky|shiba|akita\u003e/*.img\n out/target/product/husky/boot.img out/target/product/husky/vbmeta.img\n out/target/product/husky/dtb.img out/target/product/husky/vbmeta_system.img\n out/target/product/husky/dtbo.img out/target/product/husky/vendor-bootconfig.img\n out/target/product/husky/init_boot.img out/target/product/husky/vendor_boot-debug.img\n out/target/product/husky/product.img out/target/product/husky/vendor_boot.img\n out/target/product/husky/pvmfw.img out/target/product/husky/vendor_boot-test-harness.img\n out/target/product/husky/ramdisk.img out/target/product/husky/vendor.img\n out/target/product/husky/super_empty.img out/target/product/husky/vendor_kernel_boot.img\n out/target/product/husky/system_dlkm.img out/target/product/husky/vendor_kernel_ramdisk.img\n out/target/product/husky/system_ext.img out/target/product/husky/vendor_ramdisk-debug.img\n out/target/product/husky/system.img out/target/product/husky/vendor_ramdisk.img\n out/target/product/husky/system_other.img out/target/product/husky/vendor_ramdisk-test-harness.img\n out/target/product/husky/userdata.img\n\nSync and build kernel\n---------------------\n\n1. Select one of these 6.1 kernels:\n\n - `android-gs-shusky-6.1-android15-qpr2-beta` for Pixel 8 and Pixel 8 Pro devices\n - `android-gs-akita-6.1-android15-qpr2-beta` for Pixel 8a device\n2. Sync the kernel:\n\n # Sync the kernel.\n $ mkdir ~/android-gs-shusky-6.1\n $ cd ~/android-gs-shusky-6.1\n $ repo init -u https://android.googlesource.com/kernel/manifest -b \u003cvar translate=\"no\"\u003ekernel\u003c/var\u003e\n $ repo sync -c -j6\n\n3. Build the kernel:\n\n - To build the kernel for Pixel 8 or Pixel 8 Pro, use:\n\n $ ./tools/bazel run \\\n --config=shusky \\\n //private/devices/google/shusky:zuma_shusky_dist \\\n --config=16k\n\n [dist] INFO: Copying to ~/android14-gs-pixel-6.1/out/shusky/dist\n\n - To build the kernel for Pixel 8a, use:\n\n $ ./tools/bazel run \\\n --config=akita \\\n //private/devices/google/akita:zuma_akita_dist \\\n --confige=16k\n\n [dist] INFO: Copying to ~/android14-gs-pixel-6.1/out/akita/dist\n\nDownload vendor images\n----------------------\n\nThe AOSP repository doesn't contain the vendor images, which are required to\nboot the device. You can download the images from `ci.android.com`:\n\n1. Go to\n [`ci.android.com/git_aosp-main-with-phones-throttled`](https://ci.android.com/builds/branches/git_aosp-main-with-phones-throttled/grid).\n\n2. Select a build highlighted in green that corresponds to your device:\n\n - For Pixel 8 Pro, click `aosp_husky_pgagnostic`.\n\n - For Pixel 8, click `aosp_shiba_pgagnostic`.\n\n - For Pixel 8a, click `aosp_akita_16k`.\n\n The **Artifacts** tab appears at the bottom of the page.\n3. Click **Artifacts**. The artifacts for your device are listed.\n\n4. To download the artifact, click the file ending in `.sh`.\n\n5. From within the directory where the file was downloaded, run the following\n command to extract the content:\n\n $ cd ~/Downloads\n $ chmod +x aosp_\u003cselected target\u003e-flashable-\u003cbuild id\u003e-with-license.sh\n ./aosp_\u003cselected target\u003e-flashable-\u003cbuild id\u003e-with-license.sh\n\n # After reading the license, type\n Type \"I ACCEPT\" if you agree to the terms of the license: I ACCEPT\n\n # The extracted file will be in the current directory\n $ ls\n aosp_\u003cselected_target\u003e-flashable-with-license.zip\n\n # unzip that file in a directory named aosp_vendor\n $ unzip aosp_\u003cselected_target\u003e-flashable-with-license.zip -d aosp_vendor\n\n # The content of the directory will look like:\n $ ls aosp_vendor\n android-info.txt init_boot.img super_empty.img system_other.img vbmeta_vendor.img vendor_kernel_boot.img\n boot.img product.img system_dlkm.img userdata.img vendor_boot.img\n bootloader.img pvmfw.img system_ext.img vbmeta.img vendor_dlkm.img\n dtbo.img radio.img system.img vbmeta_system.img vendor.img\n\nCopy the images to a temp directory\n-----------------------------------\n\nCopy the AOSP, kernel, and vendor images to a directory in this order: \n\n $ mkdir ~/images && cd ~/images\n\n # Copy AOSP generated images\n $ cp ~/aosp_main/out/target/product/\u003cakita|husky|shiba\u003e/*.img ./images\n\n # Copy kernel generated images\n $ cp ~/android-gs-shusky-6.1/out/\u003cakita|shusky\u003e/dist ./images\n\n # Copy the vendor images\n $ cp ~/Downloads/aosp_vendor/vendor.img ./images\n $ cp ~/Downloads/aosp_vendor/vbmeta_vendor.img ./images\n\nFlash images\n------------\n\nTo flash the images, follow these steps:\n\n1. Flash the dynamic partition images:\n\n $ IMGS_DIR=~/images\n\n $ adb reboot fastboot\n\n $ fastboot flash product $IMGS_DIR/product.img\n $ fastboot flash system $IMGS_DIR/system.img\n $ fastboot flash system_ext $IMGS_DIR/system_ext.img\n $ fastboot flash system_dlkm $IMGS_DIR/system_dlkm.img\n $ fastboot flash vendor $IMGS_DIR/vendor.img\n $ fastboot flash vendor_dlkm $IMGS_DIR/vendor_dlkm.img\n\n2. Flash the kernel images:\n\n $ fastboot reboot bootloader\n\n # Wipe out /data partition\n $ fastboot -w\n\n # Disable pkvm\n $ fastboot oem pkvm disable\n\n $ fastboot flash boot $IMGS_DIR/boot.img\n $ fastboot flash init_boot $IMGS_DIR/init_boot.img\n $ fastboot flash dtbo $IMGS_DIR/dtbo.img\n $ fastboot flash vendor_kernel_boot $IMGS_DIR/vendor_kernel_boot.img\n $ fastboot flash pvmfw $IMGS_DIR/pvmfw.img\n $ fastboot flash vendor_boot $IMGS_DIR/vendor_boot.img\n\n $ fastboot flash --disable-verity --disable-verification vbmeta $IMGS_DIR/vbmeta.img\n $ fastboot flash --disable-verity --disable-verification vbmeta_system $IMGS_DIR/vbmeta_system.img\n $ fastboot flash --disable-verity --disable-verification vbmeta_vendor $IMGS_DIR/vbmeta_vendor.img\n\n3. Press the power button to boot the device.\n\n4. Check the page size with:\n\n $ adb shell getconf PAGE_SIZE\n 16384"]]