ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
การอัปเดต OTA
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
อุปกรณ์ Android ที่ใช้อยู่สามารถรับและติดตั้งการอัปเดตระบบ ซอฟต์แวร์แอป และกฎเขตเวลาผ่านอากาศ (OTA) ส่วนนี้จะอธิบายโครงสร้างของแพ็กเกจอัปเดตและเครื่องมือที่ใช้สร้างแพ็กเกจ แพ็กเกจนี้มีไว้สำหรับนักพัฒนาแอปที่ต้องการทำให้การอัปเดต OTA ทำงานในอุปกรณ์ Android รุ่นใหม่และนักพัฒนาแอปที่ต้องการสร้างแพ็กเกจอัปเดตสำหรับอุปกรณ์ที่เผยแพร่แล้ว
การอัปเดต OTA ออกแบบมาเพื่ออัปเกรดระบบปฏิบัติการพื้นฐาน แอปที่อ่านอย่างเดียวซึ่งติดตั้งไว้ในพาร์ติชันระบบ และกฎเขตเวลา การอัปเดตเหล่านี้ไม่ส่งผลต่อแอปที่ผู้ใช้ติดตั้งจาก Google Play
การอัปเดตระบบแบบ A/B เสมือนจริง (ราบรื่น)
อุปกรณ์ Android สมัยใหม่ (Android 11 ขึ้นไป) จะเก็บสำเนาของพาร์ติชันแต่ละรายการ (A และ B) ไว้ 2 รายการในระหว่างการอัปเดต กลไกการอัปเดตนี้เรียกว่า A/B เสมือนที่มีการบีบอัด แม้ว่าการอัปเดต A/B แบบเดิม (Android 10 และเวอร์ชันก่อนหน้า) จะเก็บสำเนา 2 รายการสำหรับพาร์ติชันแต่ละรายการ แต่ A/B เสมือนจะเก็บเฉพาะสล็อตจริง 2 ช่องสำหรับพาร์ติชันที่สำคัญต่อการบูต ระบบจะเขียนข้อมูลลงในสล็อตที่ไม่ได้ใช้โดยตรงสำหรับพาร์ติชันที่สำคัญต่อการบูต พาร์ติชันแบบไดนามิกมีข้อมูลระบบปฏิบัติการใหม่ซึ่งเขียนเป็นสแนปชอตที่บีบอัด เนื่องจากขนาดของรูปภาพมีแนวโน้มที่จะใหญ่กว่ามาก ภาพนิ่งที่บีบอัดช่วยให้อุปกรณ์จำลองประสบการณ์การใช้งานที่มี 2 ช่องได้ ทั้งยังช่วยลดพื้นที่เก็บข้อมูลที่ต้องการ ดูข้อมูลเพิ่มเติมเกี่ยวกับการอัปเดต A/B เสมือนผ่าน OTA ได้ที่การอัปเดตระบบ A/B เสมือน (ต่อเนื่อง) สําหรับตัวอย่างแอปที่แสดงตัวอย่างการใช้ Android System Update API (นั่นคือ update_engine
) เพื่อติดตั้งการอัปเดต A/B โปรดดูที่ SystemUpdaterSample (ดูรายละเอียดแอปได้ใน updater_sample/README.md
)
การอัปเดต A/B เดิมและการอัปเดตระบบที่ไม่ใช่ A/B
การอัปเดต A/B แบบเดิมเป็นการอัปเดต A/B เวอร์ชันแรกใน Android กลไกการอัปเดตนี้เก็บสล็อต 2 ช่องของทุกพาร์ติชันไว้ แต่มีข้อเสียคือต้องใช้พื้นที่เก็บข้อมูลมากกว่าพาร์ติชันแต่ละรายการ 2 เท่า ดูข้อมูลเพิ่มเติมได้ที่การอัปเดตระบบ A/B เราได้เลิกใช้งานการอัปเดตที่ไม่ใช่ A/B ตั้งแต่ Android 15 ดูข้อมูลเพิ่มเติมได้ที่การอัปเดตระบบที่ไม่ใช่ A/B
การอัปเดตกฎเขตเวลา
ตั้งแต่ Android 8.1 เป็นต้นไป OEM สามารถพุชข้อมูลกฎเขตเวลาที่อัปเดตไปยังอุปกรณ์ได้โดยไม่ต้องอัปเดตระบบ กลไกนี้ช่วยให้ผู้ใช้ได้รับการอัปเดตอย่างทันท่วงที (ซึ่งช่วยยืดอายุการใช้งานของอุปกรณ์ Android) และ OEM สามารถทดสอบการอัปเดตเขตเวลาได้โดยไม่เกี่ยวข้องกับการอัปเดตอิมเมจระบบ โปรดดูรายละเอียดที่หัวข้อกฎเกี่ยวกับเขตเวลา
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา 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,["# OTA updates\n\nAndroid devices in the field can receive and install over-the-air (OTA) updates to the system,\napp software, and time zone rules. This section describes the structure of update packages and\nthe tools provided to build them. It is intended for developers who want to make OTA updates\nwork on new Android devices and those who want to build update packages for released devices.\n\n\nOTA updates are designed to upgrade the underlying operating system, the read-only apps\ninstalled on the system partition, and time zone rules; these updates do *not* affect\napps installed by the user from Google Play.\n\nVirtual A/B (seamless) system updates\n-------------------------------------\n\n\nModern Android devices (Android 11 and after) maintain two copies of each partition (A and B) during an update. This\nupdate mechanism is called Virtual A/B with compression. While legacy A/B updates (Android 10 and earlier) kept two\ncopies for every single partition, Virtual A/B only keeps two physical slots for boot critical\npartitions. The unused slot is written to directly for bootcritical partitions. Dynamic\npartitions have new operating system data written as compressed snapshots since their image\nsize tends to be much larger. Compressed snapshots allows a device to simulate the experience\nof having two slots, while reducing space requirements. For more information about Virtual A/B\nOTA updates, see\n[Virtual A/B (seamless) system updates](/docs/core/ota/virtual_ab). For\na sample app that provides examples on using Android system update APIs (that is,\n`update_engine`) to install A/B updates, refer to\n[SystemUpdaterSample](https://android.googlesource.com/platform/bootable/recovery/+/android16-release/updater_sample/)\n(app details available in\n[`updater_sample/README.md`](https://android.googlesource.com/platform/bootable/recovery/+/android16-release/updater_sample/README.md)).\n\nLegacy A/B updates and Non-A/B system updates\n---------------------------------------------\n\n\nLegacy A/B updates were the first version of A/B updates in Android. This update mechanism\nkept two slots of every single partition, but had the drawback of needing twice the storage\nfor each partition. For more information see,\n[A/B system updates](/docs/core/ota/ab). As of\nAndroid 15, non A/B updates are deprecated. For more information, see\n[Non-A/B system updates](/docs/core/ota/nonab).\n\nTime zone rule updates\n----------------------\n\n\nAs of Android 8.1, OEMs can push updated time zone rules data to devices without requiring a\nsystem update. This mechanism enables users to receive timely updates (thus extending the\nuseful lifetime of an Android device) and OEMs to test time zone updates independently of\nsystem image updates. For details, see\n[Time zone rules](/docs/core/permissions/timezone-rules)."]]