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.
Cấu hình Trình quản lý gói (không dùng nữa)
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.
Việc triển khai dexopt trong trình quản lý gói chỉ áp dụng cho Android 13 trở xuống. Trong Android 14, công cụ này được thay thế bằng Dịch vụ ART và sẽ bị xoá khỏi trình quản lý gói trong phiên bản tiếp theo. Để biết thông tin về cách định cấu hình Dịch vụ ART, hãy xem phần Cấu hình dịch vụ ART.
Kể từ Android 7.0, có một cách chung để chỉ định mức độ biên dịch/xác minh đã xảy ra ở nhiều giai đoạn.
Bạn có thể định cấu hình các cấp biên dịch thông qua các thuộc tính hệ thống với các cấp mặc định là:
pm.dexopt.install=speed-profile
Đây là bộ lọc biên dịch được dùng khi cài đặt ứng dụng thông qua Google Play hoặc các cửa hàng ứng dụng khác. Bạn nên đặt bộ lọc cài đặt thành speed-profile
để cho phép sử dụng hồ sơ từ các tệp siêu dữ liệu dex (xem blog).
Xin lưu ý rằng nếu bạn không cung cấp hồ sơ hoặc hồ sơ đó trống, thì speed-profile
sẽ tương đương với verify
.
pm.dexopt.bg-dexopt=speed-profile
Đây là bộ lọc biên dịch được dùng khi thiết bị ở trạng thái rảnh và đang sạc. Hãy thử bộ lọc trình biên dịch speed-profile
để tận dụng tính năng biên dịch theo hướng dẫn của hồ sơ và lưu vào bộ nhớ.
pm.dexopt.boot-after-ota=verify
Bộ lọc biên dịch được dùng sau khi cập nhật qua mạng. Bạn nên rất dùng bộ lọc trình biên dịch verify
cho tuỳ chọn này để tránh thời gian khởi động quá lâu.
pm.dexopt.first-boot=verify
-
Bộ lọc biên dịch cho lần đầu tiên thiết bị khởi động. Bộ lọc được sử dụng ở đây chỉ ảnh hưởng đến thời gian khởi động sau khi xuất xưởng. Bạn nên dùng bộ lọc verify
để tránh thời gian chờ lâu trước khi người dùng sử dụng điện thoại lần đầu tiên. Xin lưu ý rằng nếu tất cả ứng dụng trong hình ảnh hệ thống đã được biên dịch bằng verify
, speed-profile
hoặc speed
với ngữ cảnh trình tải lớp phù hợp, thì quá trình biên dịch trong lần khởi động đầu tiên sẽ bị bỏ qua và pm.dexopt.first-boot
sẽ không có hiệu lực.
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,["# Package Manager Configuration (deprecated)\n\nThe dexopt implementation in the package manager only applies to Android\n13 and lower. In Android 14, it is replaced by ART\nService, and it will be removed from the package manager in the next version. For information about\nconfiguring ART Service, see\n[ART Service Configuration](/docs/core/runtime/configure/art-service).\n\n\nSince Android 7.0, there's a generic way to specify the level of\ncompilation/verification that happened at various stages.\nThe compilation levels can be configured via system properties\nwith the defaults being:\n\n- `pm.dexopt.install=speed-profile`\n- This is the compilation filter used when installing applications through Google Play or other app stores. We recommend the install filter be set to `speed-profile` in order to enable the use of profiles from the dex metadata files (see [blog](https://android-developers.googleblog.com/2019/04/improving-app-performance-with-art.html)). Note that if a profile isn't provided or if it is empty, `speed-profile` is equivalent to `verify`.\n- `pm.dexopt.bg-dexopt=speed-profile`\n- This is the compilation filter used when the device is idle and charging. Try the `speed-profile` compiler filter to take advantage of profile-guided compilation and save on storage.\n- `pm.dexopt.boot-after-ota=verify`\n- The compilation filter used after an over-the-air update. We **strongly** recommend the `verify` compiler filter for this option to avoid very long boot times.\n- `pm.dexopt.first-boot=verify`\n-\n The compilation filter for the first time the device ever boots. The filter\n used here only affects the boot time after factory. We recommend the filter\n `verify` for it to avoid long times before a user gets to\n use the phone for the very first time. Note that if all applications in\n the system image are already compiled with `verify`, `speed-profile`, or\n `speed` with the right class loader context, the compilation on the first boot will be\n skipped, and `pm.dexopt.first-boot` will have no effect."]]