Android sdk windows build tools

Как установить Android SDK на Windows, Mac и Linux

22 октября 2008 года в Android появился магазин приложений Play Market. С тех пор прошло больше 10 лет и сегодня Google Play насчитывает почти 3 миллиона приложений в их числе Telegram с каналом AndroidInsider. Как же разработчикам со всего мира удается создавать качественные продукты? Они используют Android SDK. Чтобы получить все инструменты и средства разработки приложений, необходимо скачать среду разработки Android Studio. Но что, если вы хотите воспользоваться Android SDK с командной строкой без Android Studio и ненужных средств? В этом материале мы подскажем, как правильно установить и настроить Software Development Kit.

Ручная установка

Переходим по этой ссылке, находим раздел «Command line tools only» и скачиваем нужную версию в зависимости от вашей системы.

Создайте папку Android в корневой папке системы. В случае с Windows это локальный диск «С», а в OS X и Linux — домашняя папка пользователя. Распакуйте скачанный архив в папку Android. Для дальнейшей работы необходим установленный пакет Java на компьютере. OS X из коробки его поддерживает, чтобы проверить это, в терминале вбейте «which java», система должна выдать расположение пакета. На Windows и Linux устанавливаем JDK по этой ссылке.

Если вы используете Linux, вам понадобится установить еще несколько пакетов с помощью этой команды «sudo apt-get install lib32ncurses5 lib32stdc++6». Для других версий Linux необходимо найти подходящие пакеты ncurses5 и stdc++6.

Установка компонентов

Переходим в папку «Android/bin», находим исполняемый файл sdkmanager и запускаем, откроется следующее окно:

Выбираем «Android SDK Tools» и «Android SDK Platform-Tools», на Windows необходимо выбрать еще и «Google USB Driver». После этого подтвердите условия лицензионного соглашения, и начнется установка инструментов. В Windows они расположатся в папке «Windows\users\Имя пользователя\AppData\Local\Android», а на Linux и Mac в папке «.Android».

Ссылки

Теперь давайте создадим символическую ссылку на эти папки, чтобы можно было быстро запустить инструменты через командную строку.

В Windows переходим в «Этот компьютер → Свойства → Дополнительные параметры системы → Дополнительно → Переменные среды». В «Переменные среды для пользователя» находим строку «Path» и кликаем по ней 2 раза. Откроется окно, в нём нажимаем «Создать» и вставляем полный путь к инструментам через точку с запятой. Должно выглядеть примерно так «C:\Android\tools;C:\Android\platform-tools».

На Mac в домашней папке находим скрытый файл «.bash_profile» или просто «.profile». Открываем его командой «nano

/.profile» и добавляем путь до инструментов:

export PATH=»$HOME/Android/tools:$PATH»
export PATH=»$HOME/Android/platform-tools:$PATH»

Сохраняем файл комбинацией «CMD+X» и далее жмём «Y». На Linux процесс аналогичен, но нужно запускать файл .bashrc.

Вот и всё. Теперь команды Android SDK доступны через консоль. Вы сможете, например, устанавливать образы и вручную обновлять смартфон.

How To Install Android SDK Tools On Windows

It provides all the steps required to install Android Platform Tools and SDK Manager on Windows 10 without using Android Studio.

In this tutorial, we will discuss all the steps required to install Android Platform Tools and SDK Manager on Windows 10. This tutorial provides the steps for Windows 10, though the steps should be the same on other versions of Windows.

This post is useful for the developers using Android Platform Tools and SDK manager without installing Android Studio for the use cases including hybrid app development using Ionic. It also assumes that a valid JAVA_HOME environment variable exists pointing to the installation directory of Java.

You can follow How To Install Java 8 On Windows 10, How To Install Java 11 On Windows, How To Install Java 15 On Windows, or How To Install OpenJDK 15 On Windows to install Java on Windows. In case you are interested in developing Android applications using Android Studio, you can also follow How To Install Android Studio On Windows.

Step 1 — Download SDK Tools

Open the download tab of Android Studio and scroll down to the Command line tools only section. This section shows various options to download the SDK tools as shown in Fig 1.

Click the first link having the download option for Windows as highlighted in Fig 1. It will ask to accept to terms and conditions as shown in Fig 2.

Go through the details, agree on the terms and conditions and click the Download Button to start the download.

Step 2 — Install Command Line Tools

In this step, we will install the Android Command Line Tools on Windows 10. Create the directory android-sdk at your preferred location and extract the content of the downloaded SDK Tools zip to this directory. Make sure that the extracted content is available within the android-sdk directory created by us as shown in Fig 3.

Читайте также:  Как найти все файлы одного формата windows 10

Step 3 — Install Platform Tools

In this step, we will install the Android Platform Tools on Windows 10. Follow the same steps similar to Android SDK Tools to install Android Platform Tools using the download link as shown in Fig 4, Fig 5, and Fig 6.

Step 4 — Configure Environment Variable

Right-click the My Computer or This PC on the desktop and click the Properties Option. Now click the Advanced system settings. It will show the System Properties dialog having Advanced Tab options as shown in Fig 7.

Click the Environment Variables Button and click the New Button in the first section. Set the Variable Name field to ANDROID_HOME and Variable Value to the android-sdk directory created by us in the previous step.

Similarly, also configure the environment variable ANDROID_SDK_ROOT to the android-sdk directory.

Also , make sure that the JAVA_HOME environment variable is set to the JDK installation directory. It must not end with the bin as we do with the system path variable.

Step 5 — Configure Commands

In previous steps, we have downloaded and extracted the Command Line Tools and Platform Tools to the android-sdk directory. Both the tools provide several command-line utilities which we need to run by going to the appropriate directory having the executable files.

We can make these commands available at the system level without going to these directories by adding the path to tools, tools\bin, and platform-tools to the system path as shown in Fig 9. Make sure that these executables do not break other commands having the same name before adding these paths to the PATH environment variable.

Now open the Command Prompt and check the ADB and SDK Manager versions as shown in Fig 10. You might be required to restart the system to apply the environment variables set by us.

We can see that the ADB command works well and shows the version details, but the sdkmanager shows an error — «error: could not determine sdk root. error: either specify it explicitly with —sdk_root= or move this package into its expected location: \cmdline-tools\latest\» since it expects the Command Line Tools in a version-specific directory. Now open the source.properties file from the cmdline-tools directory to check the version. It will show the version details as shown below.

Now move all the files to the directory cmdline-tools/3.0 as shown in Fig 10.

Also, update the system path as shown in Fig 11.

Now close and open the Command Prompt. Also, check the ADB and SDK Manager versions as shown in Fig 12.

Step 6 — Using the SDK Manager

List — We can list the installed and available packages and images using the list command as shown below.

Install Platform — Use the below-mentioned command to install the Android 10 (API level 30) using the SDK manager.

It will ask to accept the terms and conditions as shown in Fig 13. Enter y and hit Enter Key to accept the terms and conditions. This command creates the directory platforms within android-sdk and installs the package android-30 having all the required files to run the emulator for Android 10.

If we again check the installed packages, the list command shows the installed options as shown below.

Update SDK Manager — Update the SDK manager using the below-mentioned command.

Add System Image — We can add system images from available images shown by the list command using the SDK manager as shown below. We are adding the most recent default 64-bit system image.

Accept the License Agreement to complete the download.

There are several projects which need Google Play Services. We need system images specific to Google Play Services as shown below.

Accept the License Agreement to complete the download.

Install Emulator — We need to install the emulator before creating the AVD using SDK Manager.

Accept the License Agreement to complete the download.

Install Build Tools — Install the most recent build tool listed by the list command.

Step 7 — Using the Emulator and AVD Manager

Create Android Emulator — Create the emulator using the system image downloaded in the previous step as shown below. Replace with the actual name preferred by you.

Читайте также:  Livecd сброс пароля windows

The above commands ask a bunch of questions to configure the AVD if we choose the custom hardware profile option. We have excluded the details of these options from this tutorial since these configuration details depend on the actual needs. After completing all the configurations, it creates the AVD using the name provided by us while configuring it.

Similarly, we can also install the AVD of older versions as shown below.

List Android Emulators — Now go to the tools directory on the command line and check the installed platform as shown below.

Notes: Add Emulator to the system path as shown in Fig 14.

Close and re-open the Command Prompt to check the AVDs created by us in the previous steps.

It will list all the AVDs installed by us.

Run Emulator — We can run the emulator created by us as shown below.

The emulator will take some time to completely launch the AVD. The final results should look similar to Fig 15.

Delete Emulator — We can also delete an existing emulator as shown below.

Summary

This tutorial provided all the steps required to install Android Platform Tools and Android SDK Manager on Windows 10. It also provided the steps required to create and launch the AVDs using the Emulator.

SDK Build Tools release notes

Android SDK Build-Tools is a component of the Android SDK required for building Android apps. It’s installed in the /build-tools/ directory.

You should always keep your Build Tools component updated by downloading the latest version using the Android SDK Manager. If you’re using Android plugin for Gradle 3.0.0 or higher, your project automatically uses a default version of the build tools that the plugin specifies. To use a different version of the build tools, specify it using buildToolsVersion in your module’s build.gradle , as follows:

Revisions

The sections below provide notes about releases of the Build Tools. To determine which revisions of the Build Tools are available in your SDK, refer to the Installed Packages listing in the Android SDK Manager.

Build Tools, Revision 30.0.0 rc4 (May 2020)

This update includes support for building with Android 11 Preview APIs.

Build Tools, Revision 29.0.3 (January 2020)

This update fixes the following issue:

  • Build issue with Renderscript on macOS Catalina. (See issue #142590626)

Build Tools, Revision 29.0.2 (August 2019)

This update fixes the following issue:

Build Tools, Revision 29.0.0 (June 2019)

This update includes support for building with API level 29.

Build Tools, Revision 28.0.3 (September 2018)

This update includes support for Android Gradle plugin 3.2.0 and fixes the following issues:

  • Fixed a JNI library bug that caused apps to crash when calling androidx.renderscript.RenderScript.create() .
  • Fixed a bug that caused Program type already present build errors with androidx.annotation resources.

Build Tools, Revision 28.0.2 (August 2018)

Includes the latest version of D8.

Build Tools, Revision 27.0.3 (December 2017)

Improves support for compiling lambdas when you enable Java 8 language features.

Build Tools, Revision 27.0.2 (December 2017)

Build Tools, Revision 27.0.1 (November 2017)

Adds support for legacy multidex for test APKs. (Issue #37324038)

Build Tools, Revision 26.0.2 (October 2017)

In addition to general bug fixes, this release includes the following updates:

  • Updates apksigner to version 0.8:
    • Compatibility with Java 9. (Issue #37137869)
    • New —pass-encoding parameter to handle keystores and keys that are encrypted using non-ASCII passwords. If you switch to Java 9 and apksigner fails to decrypt your keystore or key, use this parameter to specify the character encoding you used to create the keystore or key. For more information, see the apksigner documentation or run apksigner sign —help from the commandline.
    • Better error message when apksigner can’t verify a JAR signature due to an unsupported digest or signature algorithm. (Issue #63525618)
  • Support for AAPT2 daemon mode when using Android plugin for Gradle 3.0.0-beta7 or higher.

Build Tools, Revision 26.0.1 (July 2017)

In addition to general bug fixes, this release restores apksigner to the build tools package (it was omitted by mistake in version 26.0.0) and includes the following updates to the tool:

  • Adds PKCS #11 support to allow signing with keys held in secure hardware. (Issue #37140484)
  • Adds support for loading additional JCA Providers before signing.
  • Honors android:targetSandboxVersion when verifying APKs.
  • When signing, rejects APKs with files that include ‘CR’ (carriage return), ‘LF’ (line feed), or ‘NUL’ (null) special characters in the file name.
  • Fixes apksigner.bat to correctly handle parameters containing spaces. (Issue #38132450)
  • Fixes a bug in JAR signature verification when multiple digests are present for the same entry in MANIFEST.MF . (Issue #38497270)

Build Tools, Revision 26.0.0 (June 2017)

Adds support for building with API level 26 and contains general bug fixes.

Читайте также:  Windows 10 как убрать кнопку войти

Build Tools, Revision 25.0.3 (April 2017)

Updates to apksigner :

  • Added —in parameter for symmetry with existing —out parameter.
  • If you do not specify the key password using —key-pass , apksigner uses the keystore password as key password. However, if the key requires a different password, you are now prompted to enter the key password from the command line. (Issue #37134986)
  • Added compatibility with jarsigner for non-ASCII passwords. (Issue #37135737)

Build Tools, Revision 25.0.2 (December 2016)

Build Tools, Revision 25.0.1 (November 2016)

This release includes bug fixes and the following improvements to apksigner :

  • Support for APKs with obfuscated JAR entry names.
  • —print-certs switch now also dumps MD5 fingerprints.

Build Tools, Revision 25.0.0 (October 2016)

Bug fixes for the Jack toolchain:

  • Fixed issue with Jack supporting non-ASCII source files. (Issue #218892)
  • Fixed issue that causes an AssertionError during some compilations. (Issue #208414)

Build Tools, Revision 24.0.3 (September 2016)

  • Added apksigner , an APK signing tool to replace jarsigner . By default, apksigner signs APKs using the conventional JAR signing scheme (used by jarsigner ) and the APK Signature Scheme v2 introduced in Android 7.0 (API level 24). Any modification to an APK signed with APK Signature Scheme v2 invalidates its signature. Thus, APK post-processing, such as zipalign , must be performed before apksigner is invoked, not after. Invoking zipalign before apksigner works fine because apksigner preserves APK alignment and compression (unlike jarsigner ).

Build Tools, Revision 23.0.3 (March 2016)

  • Fix issues in the RenderScript Support Library on arm64 devices.
  • Fix issues in the RenderScript Support Library on certain Jelly Bean devices.
  • Support renderscriptTargetAPI 21+ when using Android Plugin for Gradle, Revision 2.1.0 and above .

Build Tools, Revision 23.0.2 (November 2015)

  • Improved the merging performance of the dx tool.
  • Fixed issues in the RenderScript compiler for Windows.

Build Tools, Revision 23.0.1 (October 2015)

Fixed issues in the RenderScript tools.

Build Tools, Revision 23.0.0 (August 2015)

Added support for the Android 6.0 (API level 23) release.

Build Tools, Revision 22.0.1 (March 2015)

Fixed compatibility issues with RenderScript kernels on Android 4.4 (API level 19) to Android 4.1 (API level 16) devices.

Build Tools, Revision 22.0.0 (March 2015)

Added support for Android 5.1 (API level 22).

Build Tools, Revision 21.1.2 (February 2015)

Fixed problem with building data layouts in 32-bit mode.

Build Tools, Revision 21.1.1 (November 2014)

Fixed multidex script issues.

Build Tools, Revision 21.1 (October 2014)

Added multidex file support for APKs and Jack support to address the 64K method reference limit.

Build Tools, Revision 21.0.2 (October 2014)

Complete updates for Eclipse ADT to solve instability issues on Windows platforms.

Build Tools, Revision 21.0.1 (October 2014)

Initial updates for Eclipse ADT on Windows. Please use Revision 21.0.2.

Build Tools, Revision 21.0.0 (October 2014)

General Notes:

  • Added support for Android 5.0 (API level 21).
  • RenderScript now supports seamless 32/64-bit operation for API level 21 and higher.
  • Fixed issue with the Gradle build system when using the JaCoCo plugin. (Issue 69174)
  • Added an input-list option for use with long command lines on Windows.

Build Tools, Revision 20.0.0 (June 2014)

General Notes:

  • Added support for Android Wear.

Build Tools, Revision 19.1.0 (May 2014)

General Notes:

  • Added zipalign to the Build Tools.
  • Modified aapt to ignore XML files that fail to compile.

Build Tools, Revision 19.0.3 (March 2014)

Fixed an issue with RenderScript support.

Build Tools, Revision 19.0.2 (February 2014)

Fixed RenderScript build issues:

  • Fixed a problem with RenderScript bitcode encoding. (Issue 64775)
  • Fixed a problem with RenderScript missing math symbols (Issue 64110)

Build Tools, Revision 19.0.1 (December 2013)

Fixed miscellaneous build issues:

  • Fixed support for compiling RenderScript in NDK mode with Gradle.
  • Fixed BufferOverflowException problem in the dx build. (Issue 61710)

Build Tools, Revision 19 (October 2013)

Added support for Android 4.4 (API level 19) build targets.

Build Tools, Revision 18.1.1 (September 2013)

Fixed several minor build issues.

Build Tools, Revision 18.1.0 (September 2013)

Fixed issue with RenderScript support mode.

Build Tools, Revision 18.0.1 (July 2013)

Added support for Android 4.3 (API level 18) build targets.

Build Tools, Revision 17 (May 2013)

General Notes:

  • Included support for Android 4.2 (API level 17) build targets.
  • Decoupled the build-specific components of the Android SDK from the platform-tools component, so that the build tools can be updated independently of the integrated development environment (IDE) components.

Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.

Оцените статью