升級至最新版 Wear OS
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
從 Wear 2.0 升級
本指南說明 Wear OS 的升級程序。
Android 專屬變更
Wear 2.0 包含 API 級別 25 至 28 的多個 Android 版本。
注意:並無適用於 Android 10 (API 級別 29) 的 Wear OS 版本。
如果 Wear OS 應用程式指定 Wear OS 2.0 (API 級別 28),則要升級的作業大部分都是處理從 Android 9 (API 級別 28) 至 Android 11 (API 級別 30) 的平台變更。
由於沒有適用於 Android 10 (API 級別 29) 的 Wear OS 版本,因此當您將 compileSdkVersion
和 targetSdkVersion
欄位從 28 變更為 30 時,需要一次處理這些變更。
注意:即便您不會在應用程式中變更 compileSdkVersion
或 targetSdkVersion
,依然請您確保應用程式與 API 級別 29 相容。
Wear OS 專屬變更
Wear OS 2.0 有資訊方塊、小工具、應用程式、錶面及許多其他介面。升級應用程式時,您必須修改使用者介面,才能融入最新的設計規範。
此外,API 級別 30 包含 Ongoing Activity API持續性活動可在 Wear OS 使用者介面的其他途徑上持續顯示通知,藉此提升使用者與長時間執行活動的互動情形。
注意:Alpha 錶面 API 的某些功能僅適用於 API 級別 30 以上的裝置。
選擇初始版本
多數開發人員建構以 API 級別 30 為目標的可靠應用程式,並確定 minSdkVersion
版本夠低,這樣才能以最常見的 Android 版本為目標。舉例來說,如要允許 Wear 2.0 裝置支援,請將 minSdkVersion
設為 25。
如果你具有 Android 開發經驗,那麼大部分的知識可適用於 Wear OS。如要瞭解不同之處,請參閱「Wear OS 與行動裝置開發」。
注意:API 級別 30 的 Wear OS 模擬器系統映像檔,仍為開發人員預覽版。如需最新資訊,請參閱「版本資訊」。
適用於 Wear OS 的 Jetpack 程式庫
適用於 Wear OS 的 Jetpack 程式庫是一組程式庫,所含的功能與穿戴式裝置支援資料庫類似,能夠更有效地支援 Wear OS 3。
適用於 Wear OS 的 Jetpack 程式庫旨在取代穿戴式裝置支援資料庫,因此這兩者在設計上無法搭配使用。穿戴式裝置支援資料庫不適用於 Wear OS 3。
詳情請參閱有關 Wear OS Jetpack 程式庫穩定版的網誌文章。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[[["容易理解","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-26 (世界標準時間)。"],[],[],null,["# Upgrade to the latest version of Wear OS\n\nUpgrade from Wear 2.0\n---------------------\n\n\nThis guide describes the upgrade process for Wear OS.\n\n### Android-specific changes\n\n\nWear 2.0 encompasses multiple Android versions, from API level 25 through\nAPI level 28.\n\n**Note:** There is no version of Wear OS for Android 10 (API Level 29).\n\n\nIf your Wear OS app targets Wear OS 2.0 (API level 28), then most of the work\nto upgrade is handling the platform changes from Android 9 (API level 28) to\nAndroid 11 (API level 30).\n\nThere is no version of Wear OS for Android 10 (API Level 29), you need to handle those\nchanges all at once when you change your `compileSdkVersion` and\n`targetSdkVersion` fields from 28 to 30.\n\n**Note:** Even if you don't change the `compileSdkVersion` or\n`targetSdkVersion` in your app, ensure that your app is\n[compatible](https://developer.android.com/about/versions/11/migration#compat) with API Level 29.\n\n### Changes specific to Wear OS\n\n\n[Tiles](/training/articles/wear-tiles),\n[complications](/training/wearables/watch-faces/complications),\napps, [watch faces](/training/wearables/watch-faces), and many other surfaces\nexist in Wear OS 2.0. When you upgrade your app, you must revise your user interfaces\nto incorporate the latest design guidelines.\n\n\nAlso, API level 30 includes the\n[Ongoing Activity API](/reference/androidx/wear/ongoing/OngoingActivity).\nAn [ongoing activity](/training/wearables/ongoing-activity) lets an\nongoing notification appear on additional surfaces within the Wear OS user\ninterface, which lets users stay more engaged with long-running activities.\n\n**Note:** Some features of alpha watch face APIs are available only on\ndevices running API level 30 or higher.\n\nChoose a version to start with\n------------------------------\n\n\nMost developers build a solid app that targets API level 30 and\nleave the `minSdkVersion` version low enough to target the most prevalent Android\nversions. For example, to enable support for Wear 2.0 devices, set your `minSdkVersion`\nto 25.\n\n\nIf you have experience with Android development, much of that knowledge is applicable to Wear OS.\nTo find out what differs, read\n[Wear OS versus mobile development](/training/wearables/wear-v-mobile).\n\n\n**Note** : The API level 30 Wear OS emulator system image is in Developer\nPreview. See the\n[release notes](https://androidstudio.googleblog.com/2021/05/android-studio-arctic-fox-beta-1.html)\nfor the latest updates.\n\nJetpack libraries for Wear OS\n-----------------------------\n\n\nThe [Jetpack libraries for Wear OS](/jetpack/androidx/releases/wear) are a set of\nlibraries that contain similar functionality to the Wearable Support library and better support\nfor Wear OS 3.\n\n\nThe Jetpack libraries for Wear OS are replacements for the Wearable Support Library and aren't\ndesigned to be used together. The Wearable Support Library does not work on Wear OS 3.\n\n\nFor more information, see the blog post\n[Wear OS Jetpack libraries now in stable](https://android-developers.googleblog.com/2021/09/wear-os-jetpack-libraries-now-in-stable.html)."]]