【Andriod】Complete tutorial on SDK download, installation and environment configuration

1.Android SDK download

  1. Currently, there is no separate SDK download and installation package on the official website. Google’s official website recommends downloading Android Studio, which includes the Android SDK. Official website download address

    • As shown below, select the corresponding system to download.
      Insert image description here
  2. Because the installation package of Android Studio is too large, when using the adb command, you actually only need to use the SDK tool. Therefore, it is recommended that you go to another domestic Android tool download website androiddevtools to download.

    • After entering the page, click the [Android SDK 工具] button, then click the [SDK Tools] button in the pop-up selection box, and then the interface will automatically jump to SDK download interface, choose the version that suits you to download
      Insert image description here

2.Android SDK installation

  1. After the download is complete, clickexe文件 to install ( you can download it in zip format and unzip it directly)

    Insert image description here

  2. The first step is to click next
    Insert image description here

  3. The language used for Android development isjava, so it depends on the java environment (at least java5 or above)

    • this stepSDK会自动去找jdk的环境

    Insert image description here

  4. Choose to install to this user
    Insert image description here

  5. Select installation path
    Insert image description here

  6. Select the Start Menu folder for the Android SDK Tools shortcut.

Insert image description here

  1. Wait for installation to complete
    Insert image description here

  2. Click Finish to complete the installation
    Insert image description here

3.Configuration of Android SDK

  1. Open the Android SDK directorySDK Manager.exe(Manage Android-related configurations and Android versions)
    Insert image description here

  2. SelectDeselect AllUncheck all the boxes, then check the ones we need to install
    Insert image description here

  3. Select Android SDK Tools, Android SDK Platform-tools, Android SDK Build-Tools under Tools. These three items need to be installed

    Android SDK Tools: including testing, debugging, and third-party tools. Simulators, data management tools, etc.

    Android SDK Platform-tools: Contains platform-dependent development and debugging tools for developing apps.
    Includes:

    • adb:android调试工具
    • fastboot: boot tool.
    • platforms/directory: includes the android platform. Contained in the android.jar library. You must specify a platform as your compilation target.
    • system-images directory: compiled system images. The emulator can be loaded directly.
    • sources directory: the source code directory of android sdk.
    • samples directory: sdk examples.

    Android SDK Build-Tools: Compilation tools directory, including compilation tools converted into davlik virtual machines.
    contains:

    • aapt (Android Asset Packaging Tool): Compile the application's resource files (including AndroidManifest.xml and your Activities' xml files) and generate R.java files so that you can reference resources from your java code.
    • aidl: Convert the .aidl interface into a java interface.
    • dx: Convert .class intermediate code to dvlik intermediate code. All .class files compiled by Java need to be converted by this tool and finally packaged into apk files.
    • dexdump: dump devlik intermediate code.

Insert image description here

  1. Select one of the Android versions (Android R表示Android11) and only selectSDK PlatformInstall
    Insert image description here

  2. SelectInstall in ExtrasGoogle USB Driver(谷歌USB驱动)
    Insert image description here

  3. Check the ones you want to install and click on the lower rightinstall
    Insert image description here

  4. The installation window pops up, clickAccept License, clickInstall

Insert image description here

  1. Wait for installation to complete
    Insert image description here

  2. Installed
    Insert image description here

Note: The following are some applications corresponding to different Android versions and do not need to be installed.
Insert image description here

4. Environment variable configuration of Android SDK (win 10)

After the installation is complete, you can start configuring environment variables. The method is similar to the method of setting environment variables of JAVA JDK.

"Right-click My Computer"->"Properties"->"Advanced System Settings"->"Environment Variables"->"System Variables"->"New"

  1. Create ANDROID_HOME, the value is SDK的安装目录, such as D:\Android\android-sdk
    Insert image description here

  2. After creating the new oneANDROID_HOME, findPath变量编辑

Add the paths of \tools, \platform-tools and \build-tools\19.1.0 of the SDK to Path 变量 (These two directories will exist after you install and update Android SDK Tools, Android SDK Platform-tools, and Android SDK build-tools through the SDK Manager)

  1. New%ANDROID_HOME%\tools
  2. New %ANDROID_HOME%\platform-tools
  3. New%ANDROID_HOME%\build-tools\19.1.0
  • Note:build-tools文件下19.1.0是此版本的路径,不同的版本文件名可能不一致,所以此处修改为安装对应版本下的文件夹名

Insert image description here

  • Note: After editing the Path environment variable, click OK to save.
  1. Verify whether the environment variables are configured successfully, enter cmd with win+r, open the cmd window and enter:adb version
    • Displaying the version of adb indicates that the configuration is successful. Displaying that the adb version is not an internal or external command indicates that the configuration is not successful.
      Insert image description here

Guess you like

Origin blog.csdn.net/qq877728715/article/details/133940938