[null,null,["最后更新时间 (UTC):2025-08-21。"],[],[],null,["# Migrate your apps to Android 10\n\nWelcome! Android 10 has many new APIs for building new experiences, as well as\nupdated system behaviors that can affect your app when it's running on Android\n10 devices.\n\nTo get started, we recommend reviewing the [system behavior changes](/about/versions/10/behavior-changes-all),\n[privacy changes](/about/versions/10/privacy/changes), and [new features and APIs](/about/versions/10/highlights), then migrating your apps\nin these two phases:\n\n1. [Ensure basic compatibility](#compat). As soon as possible, make sure your existing published app is ready for users who are updating or purchasing new devices running Android 10. Test your app to verify that it's fully functional, then publish the compatible version of the app to users.\n2. [Build with Android 10 features and APIs](#use_apis). Next, explore the new features and APIs in Android 10. Set up your development environment, change your app's `targetSdkVersion`, and build with the new APIs that are relevant for your app.\n\nThe following sections highlight what you'll need to do in each of these phases.\nBefore you get started, make sure you've [prepared a hardware device](/about/versions/10/get) or\nemulator) to run and test your app.\n\nPhase 1: Basic compatibility\n----------------------------\n\nThe goal of this phase is to identify any functionality regressions or other\nimpacts when your app is running on Android 10, then address them and publish an\nupdated version to users. In many cases you shouldn't need to change your app's\n`targetSdkVersion` or use new APIs, although you can optionally change your\n`compileSdkVersion` to support compatibility.\n\nIt's important to test the functionality of your existing app through all flows,\nbecause some platform changes can affect the way your app behaves. When you\npublish the compatible version of your app, we recommend notifying users of\nAndroid 10 support in your update notes.\n\n\nTo give your users a smooth transition to Android 10, we recommend publishing a\ncompatible version of your app as early as possible --- ideally before\ndevices begin receiving Android 10 updates.\n\n### Perform testing\n\nCompatibility testing entails the same type of testing you perform when\npreparing to release your app. This is a good time to review the [core app\nquality guidelines](/develop/quality-guidelines/core-app-quality) and [best practices for testing](/training/testing).\n\nMake sure to familiarize yourself with the known behavior changes that can\naffect your app. [These behavior changes](/about/versions/10/behavior-changes-all) will apply to your app, even if you\nhaven't changed your `targetSdkVersion`. Reviewing the changes in advance will\nhelp you to identify possible impact areas and debug any issues more quickly.\n\nAndroid 10 includes extensive changes for privacy, so make sure you also [review\nthe key privacy changes](/about/versions/10/privacy/changes) and understand the possible impacts on your app.\n\nPhase 2: Build with Android 10\n------------------------------\n\nWhenever you are ready, you can explore the new features and APIs in Android 10\nand enhance your app with new experiences. To start developing with the new\nAPIs, you'll need to set up the Android 10 (API 29) SDK in Android Studio and\nchange both your `targetSdkVersion` and `compileSdkVersion` to `29`.\n\nWhen you change your `targetSdkVersion`, you'll also need to account for [system\nbehavior changes](/about/versions/10/behavior-changes-10) that apply to your app when you are targeting Android 10\n(API 29) or higher.\n\nSome behavior changes might cause regressions or crashes, so make sure to review\nthe changes and test thoroughly before publishing an app update that changes\nyour `targetSdkVersion`.\n| **Note:** The previously described steps to [ensure platform compatibility](#compat) are prerequisite to targeting your app to Android 10, so be sure to complete those steps first.\n\n### Get the SDK\n\nTo get the SDK packages to build your app with Android 10, first make sure\nyou're using the latest version of [Android Studio](/studio). To learn more, read\n[Set up the SDK](/about/versions/10/setup-sdk).\n\n### Perform testing\n\nWith the previously described preparations complete, you can build your app and\nthen test it further to make sure it works properly when targeting Android 10.\nThis is another good time to review the [core app quality guidelines](/develop/quality-guidelines/core-app-quality) and\n[best practices for testing](/training/testing).\n\nWhen you build your app with the `targetSdkVersion` set to `29`, there are\nspecific platform changes you should be aware of. Some of these changes, which\nare described on the [Android 10 behavior changes](/about/versions/10/behavior-changes-10) page, can significantly\naffect your app's behavior or cause crashes --- even if you don't yet use new\nAPIs."]]