- How to install Android SDK and setup AVD Emulator without Android Studio
- Understanding the Android SDK
- Installing the Android SDK
- Step 1 — Download the tools package
- Step 2— You need Java 8!
- Step 3 — Download the essential packages
- Step 4 — Set your environmental variables
- Step 5 — Download the platform specific packages you want
- Step 5 — Create a AVD device
- Step 6 — Run the Android Emulator
- SDK Platform Tools release notes
- Downloads
- Revisions
- 31.0.3 (August 2021)
- 31.0.2 (April 2021)
- 31.0.1 (March 2021)
- 31.0.0 (February 2021)
- 30.0.5 (November 2020)
- 30.0.4 (July 2020)
- 30.0.3 (June 2020)
- 30.0.2 (June 2020)
- 30.0.1 (May 2020)
- 30.0.0 (April 2020)
- 29.0.6 (February 2020)
- 29.0.5 (October 2019)
- 29.0.4 (September 2019)
- 29.0.3 (September 2019)
- 29.0.2 (July 2019)
- 29.0.1 (June 2019)
- 29.0.0 (June 2019)
- 28.0.2 (March 2019)
- 28.0.1 (September 2018)
- 28.0.0 (June 2018)
- 27.0.1 (December 2017)
- 27.0.0 (December 2017)
- 26.0.2 (October 2017)
- 26.0.1 (September 2017)
- 26.0.0 (June 2017)
- 25.0.5 (April 24, 2017)
- 25.0.4 (March 16, 2017)
- 25.0.3 (December 16, 2016)
- 25.0.2 (December 12, 2016)
- 25.0.1 (November 22, 2016)
- 25.0.0 (October 19, 2016)
- 24.0.4 (October 14, 2016)
- Download Android SDK Platform-Tools
- Terms and Conditions
- 1. Introduction
- 2. Accepting this License Agreement
- 3. SDK License from Google
- 4. Use of the SDK by You
- 5. Your Developer Credentials
- 6. Privacy and Information
- 7. Third Party Applications
- 8. Using Android APIs
- 9. Terminating this License Agreement
- 10. DISCLAIMER OF WARRANTIES
- 11. LIMITATION OF LIABILITY
- 12. Indemnification
- 13. Changes to the License Agreement
- 14. General Legal Terms
- Download Android SDK Platform-Tools
- Terms and Conditions
- 1. Introduction
- 2. Accepting this License Agreement
- 3. SDK License from Google
- 4. Use of the SDK by You
- 5. Your Developer Credentials
- 6. Privacy and Information
- 7. Third Party Applications
- 8. Using Android APIs
- 9. Terminating this License Agreement
- 10. DISCLAIMER OF WARRANTIES
- 11. LIMITATION OF LIABILITY
- 12. Indemnification
- 13. Changes to the License Agreement
- 14. General Legal Terms
- Download Android SDK Platform-Tools
How to install Android SDK and setup AVD Emulator without Android Studio
If you are trying to develop to Android, you probably will end up installing the Android Studio to get the Android SDK and the AVD Emulator working properly.
But if you are using another code editor, like Sublime Text or VSCode, installing the Android Studio will just mess up with your setup and consume your precious RAM for no good reason.
I had a hard time figuring out how to properly do this setup due the lack of documentation about it, so i hope this article helps you. 🙂
Recommended previous knowledge:
- SDK (Standard Development Kit); Read about on Wikipedia;
- AVD (Android Virtual Device); Read about on docs;
- CLI (Command Line Interface); Read about on Wikipedia;
- Android API levels; Read about on Vanderbilt University;
- How to open, navigate and execute files in your OS terminal;
- Know what are environmental variables;
Understanding the Android SDK
Basically, the Android SDK is a bunch of packages necessary to develop for Android.
These packages stays in subfolders of a folder called “sdk” (or “android-sdk” sometimes). You do not need to know how these packages really work, just what they do.
The picture below is my Android SDK folder, these are the basic packages you will need in order to get everything working properly.
Here is a brief explanation of each package:
- tools: This package is mainly used to manage the other packages and to create AVD’s;
- emulator: As the name suggest, this is the Android emulator;
- platform-tools: Some tools to communicate with Android devices when you plug then in your computer;
- patcher: This package is automatically downloaded by the SDK. I didn’t find what exactly this is for, so just leave it as it is;
The folders bellow contain sub-folders with the packages for each Android API level.
- platforms: The platform packages are required to compile your app for the specified API level.
- system-images: These are the android images used in the emulator.
- build-tools: These are necessary to build your Android apps
Installing the Android SDK
In order to install the SDK we will use the Command Line Tools. These are some quite simple CLI’s used to manage the Android SDK. You can read the documentation here for more details.
Step 1 — Download the tools package
First, you need to download the tools package. And with this package you can download the others.
- First, go to the Android Studio download page: https://developer.android.com/studio;
- Then click in “ Download Options”;
- There you will find a table named “ Command line tools only”;
- This table contain some zip files. Download the appropriate file for your system ( Windows, Mac or Linux);
- Extract this zip and you will get a folder called tools: This is the tools package i explained earlier;
Create a folder anywhere you prefer to place your SDK. I recommend you to stick with one of these commonly used places:
- Globally: C:\Android\sdk or C:\android-sdk (this is not default, but i usually set my SDK here on Windows)
- One user only: C:\Users\ \AppData\Local\Android\sdk
- Globally: /Library/Android/sdk
- One user only: /Users/ /Library/Android/sdk
And move the tools folder to this new sdk folder. Make sure you have admin access to this folder and any sub-folders inside it, or the tools package will fail to download new packages.
Note: You can also download a pre-build package for your SO (like the one available on Ubuntu repository). But i do not recommend you do to so, because they probably will not be updated and will be harder to manage, since it was automatically installed.
Step 2— You need Java 8!
The Android SDK packages require Java 8. If you do not have it, you need to download. If you are using a newer version, you have to downgrade to Java 8 or you will eventually get some errors, because it is not compatible.
If you do not have the Java 8 SDK, here is how you can install it:
On Ubuntu run these commands:
- # sudo apt-get update
- # sudo apt-get install openjdk-8-jdk
Sorry for MacOS users, i don’t know how to install it on this OS.
Step 3 — Download the essential packages
Now, download the platform-tools and the emulator packages, because they contain some CLI binary files you will need later. I decided to download these packages first in order to set all the necessary environment variables at once and make the rest of the process easier.
Open a terminal window (you need to use a terminal, not the file explorer), go to your sdk folder and navigate to the /tools/bin directory.
This folder contain the SDKManager binary: this is a CLI used to list the available packages in the Google’s repository and download, update or remove them from your SDK folder.
The bellow command will list all packages installed (the first items on the list) and all packages available to download:
To download the packages, simply copy the package names and pass it as a parameter to the SDKManager CLI using the terminal:
# ./sdkmanager platform-tools emulator
If you open your sdk folder you should see these packages folders there.
Step 4 — Set your environmental variables
You need to set the below environmental variables containing the path to our SDK, so any running program can find it in your pc:
ANDROID_SDK_ROOT = Path to your SDK folder
ANDROID_HOME = The same as ANDROID_SDK_ROOT. This variable is now deprecated, but i recommend setting it because some programs still using it to locate your sdk.
And add these folders to the PATH variable, making their binary files accessible from everywhere:
To add the environment variables on WIndows, just follow these steps:
- Open the “Control Panel”;
- Go to “ System and Security” option in the side menu;
- In the window “ System Properties” open the tab “ Advanced”;
- Click in the button “ Environment Variables” in the bottom of the page;
- In the “ Environment Variables” window you will see two tables: “User Variables” and ” System Variables”.
- If you created your sdk folder for one user only, set the variables in the “ User Variables” table;
- But, if you create your sdk folder globally, set the variables in the “ System Variables” table instead;
On Linux, you can set your environment variables in many places. So i choose the ones I found the most appropriate:
- If you created your sdk folder for one user only, set your environment variables in the file
/.bashrc;
Here is how i set these variables in my Ubuntu, using the file /etc/environment:
And sorry again, no MacOS instructions for this task.
You can find more about these environmental variables in the oficial docs here.
Now your SDK is ready! If you do not need to run the emulator there’s no need to follow the next steps.
Step 5 — Download the platform specific packages you want
You need more three packages: The platform, the system-image and the build-tools. You can download these packages for any Android version you prefer. In this article, i will download the packages for the API Level 28.
Use the “ sdkmanager — list” command to find these packages and download them using the command “ sdkmanager
Here’s an example:
Step 5 — Create a AVD device
Creating a AVD device is a simple task: run the AVDManager command (this is a binary file located in the tools/bin folder of your sdk) with the create avd option, a name for the new AVD and the image you want to use.
Here is a example:
# avdmanager create avd — name android28 — package “system-images;android-28;default;x86”
You will be asked if you want to alter some configurations. You can also modify these configurations later in the file config.ini, located in the avd folder (this folder usually is created in your user folder, under the android directory). The currently active configurations can be find in the file hardware-qemu.ini (this file just will be created after the emulator runs for the first time).
Step 6 — Run the Android Emulator
Now you just need to run the emulator command (remember that we added this package to the environmental variables?):
The emulator take some time to init for the first time. But if you done everything correctly you should see this screen:
Источник
SDK Platform Tools release notes
Android SDK Platform-Tools is a component for the Android SDK. It includes tools that interface with the Android platform, such as adb , fastboot , and systrace . These tools are required for Android app development. They’re also needed if you want to unlock your device bootloader and flash it with a new system image.
Although some new features in these tools are available only for recent versions of Android, the tools are backward compatible, so you need only one version of the SDK Platform-Tools.
Downloads
If you’re an Android developer, you should get the latest SDK Platform-Tools from Android Studio’s SDK Manager or from the sdkmanager command-line tool. This ensures the tools are saved to the right place with the rest of your Android SDK tools and easily updated.
But if you want just these command-line tools, use the following links:
- Download SDK Platform-Tools for Windows
- Download SDK Platform-Tools for Mac
- Download SDK Platform-Tools for Linux
Although these links do not change, they always point to the most recent version of the tools.
Revisions
31.0.3 (August 2021)
- fastboot
- Support flashing vbmeta_vendor.img for fastboot flashall / update.
31.0.2 (April 2021)
- adb
- Support forwarding to vsock on linux.
- Fix bug in adb track-devices where devices over wireless debugging wouldn’t immediately receive updates.
- Implement preliminary support for mDNS device discovery without a separately installed mDNS service. This is currently disabled by default, and can be enabled by setting the environment variable ADB_MDNS_OPENSCREEN to 1 when starting the adb server.
- fastboot
- Don’t fail when unable to get boot partition size.
- Derive device locked state from property instead of parsing the kernel command line.
31.0.1 (March 2021)
- adb
- Reduce TCP keepalive interval.
- Improve incremental installation performance.
- fastboot
- Add support for compressed snapshot merges.
- Restore legacy A/B support.
31.0.0 (February 2021)
- adb
- Disable compression on pull by default.
30.0.5 (November 2020)
- adb
- Improve performance of adb push when pushing many files over a high-latency connection.
- Improve adb push/pull performance on Windows.
- Fix adb push —sync with multiple inputs.
- Improve performance of incremental apk installation.
- Improve error handling for incremental apk installation.
30.0.4 (July 2020)
- adb
- Fix fallback to non-incremental apk installation on pre-Android 11 devices.
- Fix adb install-multi-package .
- Fix some more crashes related to adb wireless pairing.
- Improve some error messages.
- fastboot
- Improve console output on fastboot oem commands.
- Fix fastboot flashall on older devices such as Nexus 7.
30.0.3 (June 2020)
- adb
- Fix installation of APKs signed with v4 signature scheme on pre-Android 11 devices.
- Fix crash when authenticating without ADB_VENDOR_KEYS .
- Fix crash when using adb -H .
30.0.2 (June 2020)
- adb
- Improve adb wireless pairing.
- Fix hang in adb logcat when run before a device is connected.
- Add adb transport-id to allow scripts to safely wait for a device to go away after root/unroot/reboot.
30.0.1 (May 2020)
- adb
- Disable adb mdns auto-connection by default. This can be reenabled with the ADB_MDNS_AUTO_CONNECT environment variable.
- Improve performance of adb install-multi on Android 10 or newer devices.
- Fix timeout when using adb root/unroot on a device connected over TCP.
- Update support for wireless pairing.
30.0.0 (April 2020)
- adb
- Add initial support for wireless pairing.
- Add support for incremental APK installation.
- Implement client-side support for compression of adb
when used with an Android 11 device. - Improve performance of adb push on high-latency connections.
- Improve push/pull performance on Windows.
29.0.6 (February 2020)
- adb
- 64-bit size/time support for adb ls when used with an Android 11 device.
- Support listening on ::1 on POSIX.
- Client support for WinUSB devices that publish a WinUSB descriptor (required for Android 11) should no longer require a USB driver to be installed.
- Fix hang when using adb install on something that isn’t actually a file.
29.0.5 (October 2019)
- adb
- Slight performance improvement on Linux when using many simultaneous connections.
- Add —fastdeploy option to adb install , for incremental updates to APKs while developing.
29.0.4 (September 2019)
- adb
- Hotfix for native debugging timeout with LLDB (see issue #134613180). This also fixes a related bug in the Android Studio Profilers that causes an AdbCommandRejectedException , which you can see in the idea.log file.
29.0.3 (September 2019)
- adb
- adb forward —list works with multiple devices connected.
- Fix devices going offline on Windows.
- Improve adb install output and help text.
- Restore previous behavior of adb connect without specifying port.
29.0.2 (July 2019)
- adb
- Fixes a Windows heap integrity crash.
- fastboot
- Adds support for partition layout of upcoming devices.
29.0.1 (June 2019)
- adb
- Hotfix for Windows crashes (https://issuetracker.google.com/134613180)
29.0.0 (June 2019)
- adb
- adb reconnect performs a USB reset on Linux.
- On Linux, when connecting to a newer adb server, instead of killing the server and starting an older one, adb attempts to launch the newer version transparently.
- adb root waits for the device to reconnect after disconnecting. Previously, adb root; adb wait-for-device could mistakenly return immediately if adb wait-for-device started before adb noticed that the device had disconnected.
- fastboot
- Disables an error message that occurred when fastboot attempted to open the touch bar or keyboard on macOS.
28.0.2 (March 2019)
- adb
- Fixes flakiness of adb shell port forwarding that leads to «Connection reset by peer» error message.
- Fixes authentication via ADB_VENDOR_KEYS when reconnecting devices.
- Fixes authentication—when the private key used for authentication does not match the public key—by calculating the public key from the private key, instead of assuming that they match.
- fastboot
- Adds support for dynamic partitions.
- Updated Windows requirements
- The platform tools now depend on the Windows Universal C Runtime, which is usually installed by default via Windows Update. If you see errors mentioning missing DLLs, you may need to manually fetch and install the runtime package.
28.0.1 (September 2018)
- adb
- Add support for reconnection of TCP connections. Upon disconnection, adb will attempt to reconnect for up to 60 seconds before abandoning a connection.
- Fix Unicode console output on Windows. (Thanks to external contributor Spencer Low!)
- Fix a file descriptor double-close that can occur, resulting in connections being closed when an adb connect happens simultaneously.
- Fix adb forward —list when used with more than one device connected.
- fastboot
- Increase command timeout to 30 seconds, to better support some slow bootloader commands.
28.0.0 (June 2018)
- adb:
- Add support for checksum-less operation with devices running Android P, which improves throughput by up to 40%.
- Sort output of adb devices by connection type and device serial.
- Increase the socket listen backlog to allow for more simulataneous adb commands.
- Improve error output for adb connect .
- fastboot:
- Improve output format, add a verbose output mode ( -v ).
- Clean up help output.
- Add product.img and odm.img to the list of partitions flashed by fastboot flashall .
- Avoid bricking new devices when using a too-old version of fastboot by allowing factory image packages to require support for specific partitions.
27.0.1 (December 2017)
- adb: fixes an assertion failure on MacOS that occurred when connecting devices using USB 3.0.
- Fastboot: On Windows, adds support for wiping devices that use F2FS (Flash-Friendly File System).
27.0.0 (December 2017)
- Re-fixes the macOS 10.13 fastboot bug first fixed in 26.0.1, but re-introduced in 26.0.2.
26.0.2 (October 2017)
- Add fastboot support for Pixel 2 devices.
26.0.1 (September 2017)
- Fixed fastboot problems on macOS 10.13 High Sierra (bug 64292422).
26.0.0 (June 2017)
- Updated with the release of Android O final SDK (API level 26).
25.0.5 (April 24, 2017)
Fixed adb sideload of large updates on Windows, manifesting as «std::bad_alloc» (bug 37139736).
Fixed adb problems with some Windows firewalls, manifesting as «cannot open transport registration socketpair» (bug 37139725).
Both adb —version and fastboot —version now include the install path.
Changed adb to not resolve localhost to work around misconfigured VPN.
Changed adb to no longer reset USB devices on Linux, which could affect other attached USB devices.
25.0.4 (March 16, 2017)
- Added experimental libusb support to Linux and Mac adb
To use the libusb backend, set the environment variable ADB_LIBUSB=true before launching a new adb server. The new adb host-features command will tell you whether or not you’re using libusb.
To restart adb with libusb and check that it worked, use adb kill-server; ADB_LIBUSB=1 adb start-server; adb host-features . The output should include «libusb».
In this release, the old non-libusb implementation remains the default.
fastboot doesn’t hang 2016 MacBook Pros anymore (bug 231129)
Fixed Systrace command line capture on Mac
25.0.3 (December 16, 2016)
- Fixed fastboot bug causing Android Things devices to fail to flash
25.0.2 (December 12, 2016)
- Updated with the Android N MR1 Stable release (API 25)
25.0.1 (November 22, 2016)
- Updated with the release of Android N MR1 Developer Preview 2 release (API 25)
25.0.0 (October 19, 2016)
- Updated with the release of Android N MR1 Developer Preview 1 release (API 25)
24.0.4 (October 14, 2016)
- Updated to address issues in ADB and Mac OS Sierra
Download Android SDK Platform-Tools
Before downloading, you must agree to the following terms and conditions.
Terms and Conditions
1. Introduction
2. Accepting this License Agreement
3. SDK License from Google
4. Use of the SDK by You
5. Your Developer Credentials
6. Privacy and Information
7. Third Party Applications
8. Using Android APIs
9. Terminating this License Agreement
10. DISCLAIMER OF WARRANTIES
11. LIMITATION OF LIABILITY
12. Indemnification
13. Changes to the License Agreement
14. General Legal Terms
Download Android SDK Platform-Tools
Before downloading, you must agree to the following terms and conditions.
Terms and Conditions
1. Introduction
2. Accepting this License Agreement
3. SDK License from Google
4. Use of the SDK by You
5. Your Developer Credentials
6. Privacy and Information
7. Third Party Applications
8. Using Android APIs
9. Terminating this License Agreement
10. DISCLAIMER OF WARRANTIES
11. LIMITATION OF LIABILITY
12. Indemnification
13. Changes to the License Agreement
14. General Legal Terms
Download Android SDK Platform-Tools
Before downloading, you must agree to the following terms and conditions.
Источник