ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
ใช้ Cuttlefish กับหน้าขนาด 16 KB ใน ARM64
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การตั้งค่านี้ต้องใช้โฮสต์ ARM64
Linux หน้านี้แสดงวิธีสร้างและเริ่ม Cuttlefish ที่รองรับขนาดหน้า 16 KB ใน ARM64
วิธีการในหน้านี้จะถือว่ามีการติดตั้งแพ็กเกจ Cuttlefish ในเครื่องแล้ว โปรดดูวิธีการติดตั้งที่ขั้นตอนที่ 1 ของติดตั้ง Cuttlefish
คุณสามารถเปิด Cuttlefish ได้โดยดาวน์โหลดอาร์ติแฟกต์ที่สร้างไว้ล่วงหน้าจากเว็บไซต์การผสานรวมแบบต่อเนื่องของ Android โดยตรง หรือสร้างจาก AOSP หากต้องการแก้ไขซอร์สโค้ด
เปิด Cuttlefish โดยดาวน์โหลดอาร์ติแฟกต์
ไปที่เว็บไซต์การผสานรวมอย่างต่อเนื่องของ Android และป้อน aosp-main-throttled
เป็นชื่อสาขา คลิกบิลด์ล่าสุดสําหรับเป้าหมาย aosp_cf_arm64_phone_pgagnostic
จากนั้นทำตามวิธีการจากขั้นตอนที่ 5 ของติดตั้ง Cuttlefish
เปิด Cuttlefish โดยการคอมไพล์จาก AOSP
สร้างและเปิดใช้งาน Cuttlefish โดยใช้เป้าหมายที่ไม่เจาะจงหน้าเว็บ
$ mkdir android-latest-branch && cd android-latest-branch
$ repo init -u https://android.googlesource.com/platform/manifest -b android-latest-release
$ repo sync -c -j32
# Build cf agnostic target.
$ source build/envsetup.sh
$ lunch aosp_cf_arm64_phone_pgagnostic-trunk_staging-userdebug
$ m
# Launch cf with a kernel with 16 KB page size support.
$ launch_cvd
...
...
VIRTUAL_DEVICE_DISPLAY_POWER_MODE_CHANGED
virtio_input_hid_handle_status: unknown type 20
virtio_input_hid_handle_status: unknown type 20
virtio_input_hid_handle_status: unknown type 20
virtio_input_hid_handle_status: unknown type 20
Generating new secret with slot ID: 4
VIRTUAL_DEVICE_BOOT_STARTED
VIRTUAL_DEVICE_NETWORK_MOBILE_CONNECTED
ยืนยันขนาดหน้าเว็บและการบูต
วิธียืนยันขนาดหน้าเว็บและสถานะการบูต
เข้าถึงเชลล์ในฐานะรูท
$ adb root
adbd is already running as root
$ adb shell
vsoc_arm64_pgagnostic:/ #
ยืนยันขนาดหน้าเว็บและสถานะการบูต
vsoc_arm64_pgagnostic:/ # getconf PAGE_SIZE
16384
vsoc_arm64_pgagnostic:/ # getprop | grep sys.boot.completed
sys.boot_completed: 1
ใช้ Cuttlefish กับเคอร์เนลขนาดหน้า 16 KB ที่กําหนดเอง
วิธีใช้เคอร์เนลที่กำหนดเองแทนเคอร์เนลที่สร้างไว้ล่วงหน้า
สร้างไดเรกทอรี repo สำหรับเคอร์เนล Android Common และซิงค์ไดเรกทอรี
$ mkdir common-android14-6.1 && cd common-android14-6.1
$ repo init -u https://android.googlesource.com/kernel/manifest -b common-android14-6.1
$ repo sync -c -j$(nproc)
สร้างเคอร์เนลขนาดหน้า 16 KB โดยทำดังนี้
$ tools/bazel run --lto=none //common:kernel_aarch64_16k_dist
$ tools/bazel run --lto=none //common-modules/virtual-device:virtual_device_aarch64_16k_dist -- \
--dist_dir=out/android14-6.1/dist
ยืนยันว่าการบิลด์ทํางานสําเร็จ
# Generated files
$ ls out/android14-6.1/dist/Image
$ ls out/android14-6.1/dist/initramfs.img
เริ่ม Cuttlefish ด้วยเคอร์เนลขนาดหน้า 16 KB ที่กําหนดเอง
วิธีใช้เคอร์เนลที่เพิ่งสร้างขึ้นใหม่ใน Cuttlefish
$ launch_cvd -kernel_path ~/common-android14-6.1/out/android14-6.1/dist/Image \
-initramfs_path ~/common-android14-6.1/out/android14-6.1/dist/initramfs.img \
--resume=false --userdata_format=ext4 \
--data_policy=always_create --blank_data_image_mb=8000
-userdata_format=ext4
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ 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,["# Use Cuttlefish with 16 KB page size on ARM64\n\nThis setup requires an `ARM64` Linux host. This page shows how to build and\nstart Cuttlefish with 16 KB page size support on `ARM64`. The instructions on\nthis page assume that Cuttlefish packages are installed in your machine. For\ninstructions to install them, see Step 1 of [Install Cuttlefish](/docs/devices/cuttlefish/get-started#launch).\n\nYou can launch Cuttlefish by either [downloading the prebuilt\nartifacts](#download-build-artifacts) directly from the Android Continuous\nIntegration site or [build them from AOSP](#sync-build) if you need to modify\nthe source code.\n\nLaunch Cuttlefish by downloading the artifacts\n----------------------------------------------\n\nNavigate to [Android Continuous Integration site](https://ci.android.com) and\nenter `aosp-main-throttled` as the branch name. Click the latest build for the\n`aosp_cf_arm64_phone_pgagnostic` target. Now, follow the instructions from Step\n5 of [Install Cuttlefish](/docs/devices/cuttlefish/get-started#launch).\n\nLaunch Cuttlefish by building from AOSP\n---------------------------------------\n\nBuild and launch Cuttlefish with a page-agnostic target: \n\n $ mkdir android-latest-branch && cd android-latest-branch\n $ repo init -u https://android.googlesource.com/platform/manifest -b android-latest-release\n $ repo sync -c -j32\n\n # Build cf agnostic target.\n $ source build/envsetup.sh\n $ lunch aosp_cf_arm64_phone_pgagnostic-trunk_staging-userdebug\n $ m\n\n # Launch cf with a kernel with 16 KB page size support.\n $ launch_cvd\n ...\n ...\n VIRTUAL_DEVICE_DISPLAY_POWER_MODE_CHANGED\n virtio_input_hid_handle_status: unknown type 20\n virtio_input_hid_handle_status: unknown type 20\n virtio_input_hid_handle_status: unknown type 20\n virtio_input_hid_handle_status: unknown type 20\n Generating new secret with slot ID: 4\n VIRTUAL_DEVICE_BOOT_STARTED\n VIRTUAL_DEVICE_NETWORK_MOBILE_CONNECTED\n\nVerify page size and boot\n-------------------------\n\nTo verify page size and boot status:\n\n1. Access the shell as root:\n\n $ adb root\n adbd is already running as root\n $ adb shell\n vsoc_arm64_pgagnostic:/ #\n\n2. Verify page size and boot status:\n\n vsoc_arm64_pgagnostic:/ # getconf PAGE_SIZE\n 16384\n vsoc_arm64_pgagnostic:/ # getprop | grep sys.boot.completed\n sys.boot_completed: 1\n\nUse Cuttlefish with custom 16 KB page size kernel\n-------------------------------------------------\n\nTo use a custom kernel, instead of a prebuilt kernel:\n\n1. Create a repo directory for an android common kernel and sync the directory:\n\n $ mkdir common-android14-6.1 && cd common-android14-6.1\n $ repo init -u https://android.googlesource.com/kernel/manifest -b common-android14-6.1\n $ repo sync -c -j$(nproc)\n\n2. Build 16 KB page size kernel:\n\n $ tools/bazel run --lto=none //common:kernel_aarch64_16k_dist\n $ tools/bazel run --lto=none //common-modules/virtual-device:virtual_device_aarch64_16k_dist -- \\\n --dist_dir=out/android14-6.1/dist\n\n3. Verify that the build executed successfully:\n\n # Generated files\n $ ls out/android14-6.1/dist/Image\n $ ls out/android14-6.1/dist/initramfs.img\n\n### Start Cuttlefish with the custom 16 KB page size kernel\n\nTo use your newly built kernel in Cuttlefish: \n\n $ launch_cvd -kernel_path ~/common-android14-6.1/out/android14-6.1/dist/Image \\\n -initramfs_path ~/common-android14-6.1/out/android14-6.1/dist/initramfs.img \\\n --resume=false --userdata_format=ext4 \\\n --data_policy=always_create --blank_data_image_mb=8000\n -userdata_format=ext4"]]