קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כדי לפתח באמצעות ממשקי API של Android 13 ולבדוק את האפליקציה עם שינויי ההתנהגות ב-Android 13, צריך להגדיר את ה-SDK של Android 13. פועלים לפי ההוראות שבדף הזה כדי להגדיר את Android 13 SDK ב-Android Studio, ליצור את האפליקציה ולהריץ אותה ב-Android 13.
הורדת Android Studio
ה-SDK של Android 13 כולל שינויים שלא תואמים לגרסאות מסוימות של Android Studio בגרסאות קודמות. כדי ליהנות מחוויית הפיתוח הטובה ביותר עם Android SDK 13, מומלץ להשתמש ב-Android Studio Chipmunk | 2021.2.1 ואילך.
בכרטיסייה SDK Tools, מרחיבים את הקטע Android SDK Build-Tools 34 ובוחרים את הגרסה האחרונה של 33.x.x.
לוחצים על Apply (החלה) > OK (אישור) כדי להוריד ולהתקין את החבילות שנבחרו.
עדכון תצורת ה-build של האפליקציה
כדי לגשת לממשקי API של Android 13 ולבדוק אם האפליקציה תואמת ל-Android 13, צריך לפתוח את הקובץ build.gradle או build.gradle.kts ברמת המודול ולעדכן אותם בערכים ל-Android 13. הפורמט של הערכים משתנה בהתאם לגרסה של פלאגין Android Gradle (AGP) שבה אתם משתמשים.
AGP 7.0.0 ומעלה
אם אתם משתמשים ב-AGP 7.0.0 ואילך, עליכם לעדכן את הקובץ build.gradle או את הקובץ build.gradle.kts של האפליקציה בערכים הבאים ל-Android 13:
Groovy
android{compileSdk33defaultConfig{targetSdk33}}
Kotlin
android{compileSdk=33defaultConfig{targetSdk=33}}
AGP 4.2.0 ואילך
אם משתמשים ב-AGP 4.2.0 ומטה, צריך לעדכן את קובץ build.gradle או build.gradle.kts של האפליקציה עם הערכים הבאים ל-Android 13:
למידע נוסף על התכונות וממשקי ה-API החדשים שזמינים ב-Android 13, אפשר לקרוא את המאמר התכונות ב-Android 13.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. 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,["# Set up the Android 13 SDK\n\nTo develop with Android 13 APIs and test your app with the Android 13 behavior\nchanges, you need to set up the Android 13 SDK. Follow the instructions on this\npage to set up the Android 13 SDK in Android Studio and build and run your app\non Android 13.\n\nGet Android Studio\n------------------\n\nThe Android 13 SDK includes changes that are not compatible with some lower\nversions of Android Studio. For the best development experience with the Android\n13 SDK, use Android Studio Chipmunk \\| 2021.2.1 or higher.\n\n[Get Android Studio](/studio)\n\nInstall the SDK\n---------------\n\nWithin Android Studio, you can install the Android 13 SDK as follows:\n\n1. Click **Tools \\\u003e SDK Manager** , then click **Show Package Details**.\n2. In the **SDK Platforms** tab, expand the **Android 13.0 (\"Tiramisu\")** section and select the **Android SDK Platform 33** package.\n3. In the **SDK Tools** tab, expand the **Android SDK Build-Tools 34** section and select the latest `33.x.x` version.\n4. Click **Apply \\\u003e OK** to download and install the selected packages.\n\nUpdate your app's build configuration\n-------------------------------------\n\nTo access Android 13 APIs and test your app's compatibility with Android 13,\nopen your module-level `build.gradle` or `build.gradle.kts` file, and update\nthem with values for Android 13. How you format the values depends on the\nversion of the Android Gradle plugin (AGP) that you are using.\n| **Note:** If you aren't quite ready to fully support Android 13, you can still perform app compatibility testing by using a debuggable app, an Android 13 device, and the [compatibility framework](/about/versions/13/reference/compat-framework-changes), without changing your app to compile with or target the SDK.\n\n### AGP 7.0.0 or higher\n\nIf you are using AGP 7.0.0 or higher, update your app's `build.gradle` or\n`build.gradle.kts` file with the following values for Android 13: \n\n### Groovy\n\n```groovy\nandroid {\n compileSdk 33\n\n defaultConfig {\n targetSdk 33\n }\n}\n```\n\n### Kotlin\n\n```kotlin\nandroid {\n compileSdk = 33\n\n defaultConfig {\n targetSdk = 33\n }\n}\n```\n\n### AGP 4.2.0 or lower\n\nIf you are using AGP 4.2.0 or lower, update your app's `build.gradle` or\n`build.gradle.kts` file with the following values for Android 13: \n\n### Groovy\n\n```groovy\nandroid {\n compileSdkVersion \"33\"\n\n defaultConfig {\n targetSdkVersion \"33\"\n }\n}\n```\n\n### Kotlin\n\n```kotlin\nandroid {\n compileSdkVersion = \"33\"\n\n defaultConfig {\n targetSdkVersion = \"33\"\n }\n}\n```\n\nNext steps\n----------\n\nTo learn about which changes might affect you, and to learn how to test these\nchanges in your app, read the following topics:\n\n- [Behavior changes that affect all apps](/about/versions/13/behavior-changes-all)\n- [Behavior changes that affect only apps that target Android 13](/about/versions/13/behavior-changes-13)\n\nTo learn more about new APIs and features available in Android 13, read [Android\n13 features](/about/versions/13/features)."]]