Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Sử dụng Cuttlefish với kích thước trang 16 KB trên ARM64
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Cấu hình thiết lập này yêu cầu máy chủ Linux ARM64
. Trang này cho biết cách tạo và khởi động Cuttlefish với tính năng hỗ trợ kích thước trang 16 KB trên ARM64
. Hướng dẫn trên trang này giả định rằng bạn đã cài đặt các gói Cuttlefish trên máy. Để biết hướng dẫn cài đặt, hãy xem Bước 1 trong phần Cài đặt Cuttlefish.
Bạn có thể chạy Cuttlefish bằng cách tải các cấu phần phần mềm tạo sẵn trực tiếp từ trang web Tích hợp liên tục của Android hoặc tạo các cấu phần phần mềm đó từ AOSP nếu cần sửa đổi mã nguồn.
Chạy Cuttlefish bằng cách tải cấu phần phần mềm xuống
Chuyển đến trang web Tích hợp liên tục của Android rồi nhập aosp-main-throttled
làm tên nhánh. Nhấp vào bản dựng mới nhất cho mục tiêu aosp_cf_arm64_phone_pgagnostic
. Bây giờ, hãy làm theo hướng dẫn trong Bước 5 của phần Cài đặt Cuttlefish.
Chạy Cuttlefish bằng cách tạo bản dựng từ AOSP
Tạo và chạy Cuttlefish bằng một mục tiêu không phân biệt trang:
$ 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
Xác minh kích thước trang và khởi động
Cách xác minh kích thước trang và trạng thái khởi động:
Truy cập vào shell với quyền root:
$ adb root
adbd is already running as root
$ adb shell
vsoc_arm64_pgagnostic:/ #
Xác minh kích thước trang và trạng thái khởi động:
vsoc_arm64_pgagnostic:/ # getconf PAGE_SIZE
16384
vsoc_arm64_pgagnostic:/ # getprop | grep sys.boot.completed
sys.boot_completed: 1
Sử dụng Cuttlefish với nhân có kích thước trang 16 KB tuỳ chỉnh
Cách sử dụng hạt nhân tuỳ chỉnh thay vì hạt nhân tạo sẵn:
Tạo thư mục kho lưu trữ cho hạt nhân Android chung và đồng bộ hoá thư mục:
$ 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)
Tạo nhân có kích thước trang 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
Xác minh rằng bản dựng đã thực thi thành công:
# Generated files
$ ls out/android14-6.1/dist/Image
$ ls out/android14-6.1/dist/initramfs.img
Khởi động Cuttlefish bằng nhân có kích thước trang 16 KB tuỳ chỉnh
Cách sử dụng nhân mới tạo trong 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
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 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"]]