Update the IDE and SDK tools  

您所在的位置:网站首页 Android安装SDK Update the IDE and SDK tools  

Update the IDE and SDK tools  

2024-03-11 02:34| 来源: 网络整理| 查看: 265

Android Emulator A QEMU-based device-emulation tool that you can use to debug and test your applications in an actual Android runtime environment. For more details, see the Emulator release notes.

Note: Most API libraries that were previously provided by the Support Repository packages (such as the Android Support Library, Constraint Layout, Google Play services, and Firebase) are now available from Google's Maven repository. Projects created with Android Studio 3.0 and higher automatically include this repository in the build configuration. If you're using an older project, you must manually add Google's Maven repository to your build.gradle or build.gradle.kts file.

Intel or ARM System Images The system image is required to run the Android Emulator. Each platform version contains the supported system images. You can also download system images later when creating Android Virtual Devices (AVDs) in the AVD Manager. Select either Intel or ARM based on your development computer's processor. Google Play services Includes a set of libraries, Javadocs, and samples to help build your app. If you want to use APIs from Google Play services, you must use either the Google APIs system image or the Google play system image.

The preceding list is not comprehensive, and you can add other sites to download additional packages from third parties, as described in the following section.

In some cases, an SDK package might require a specific minimum revision of another tool. If so, the SDK Manager notifies you with a warning and adds the dependencies to your list of downloads.

Edit or add SDK tool sites

Under the SDK Update Sites tab, you can add and manage other sites that host their own tools, and then download the packages from those sites. Android Studio checks for Android tools and third-party tool updates from the SDK sites you add.

For example, a mobile carrier or device manufacturer might offer additional API libraries that are supported by their own Android-powered devices. To develop using their libraries, you can install their Android SDK package by adding their SDK tools URL to the SDK Manager in the SDK Update Sites tab.

If a carrier or device manufacturer has hosted an SDK add-on repository file on their website, follow these steps to add the site to the Android SDK Manager:

Click the SDK Update Sites tab. Click Add at the top of the window. Enter the name and URL of the third-party site, then click OK. Make sure the checkbox is selected in the Enabled column. Click Apply or OK.

Any SDK packages available from the site now appear in the SDK Platforms or SDK Tools tabs, as appropriate.

Auto-download missing packages with Gradle

When you run a build from the command line or Android Studio, Gradle can automatically download missing SDK packages that a project depends on, as long as the corresponding SDK license agreements have already been accepted in the SDK Manager.

When you accept the license agreements using the SDK Manager, Android Studio creates a licenses directory inside the SDK home directory. This licenses directory is necessary for Gradle to auto-download missing packages.

If you have accepted the license agreements on one workstation but want to build your projects on a different one, you can export your licenses by copying over the accepted licenses directory.

To copy the licenses to another machine, follow these steps:

On a machine with Android Studio installed, click Tools > SDK Manager. At the top of the window, note the Android SDK Location.

Navigate to that directory and locate the licenses/ directory inside it.

If you don't see a licenses/ directory, return to Android Studio, update your SDK tools, and accept the license agreements. When you return to the Android SDK home directory, you should see the directory.

Copy the entire licenses/ directory and paste it into the Android SDK home directory on the machine where you want to build your projects.

Gradle can now automatically download missing packages your project depends on.

Note that this feature is automatically disabled for builds you run from Android Studio, as the SDK manager handles downloading missing packages for the IDE. To manually disable this feature, set android.builder.sdkDownload=false in the gradle.properties file for your project.

Update your tools with the command line

On systems that don't have a graphical UI, such as CI servers, you can't use the SDK Manager in Android Studio. Instead, use the sdkmanager command-line tool to install and update SDK tools and platforms.

After installing SDK tools and platforms using sdkmanager, you might need to accept any missing licenses. This can also be done using sdkmanager:

$ sdkmanager --licenses

This command scans all of the installed SDK tools and platforms and displays any licenses that have not been accepted. You are prompted to accept each license.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3