Getting the source code

Branches

We currently have the following possible branches for previous versions of Android Studio:

dev branch

release branch

IntelliJ

Notes

studio-1.0-dev

studio-1.0-release

idea13-dev

This is the branch for 1.0 work CLOSED

studio-1.1-dev

studio-1.1-release

idea13-1.1-dev

This is the branch for 1.1 work CLOSED

studio-1.2-dev

studio-1.2-release

idea14-1.2-dev

This is the branch for 1.2 work CLOSED

studio-1.3-dev

studio-1.3-release

idea14-1.3-dev

This is the branch for 1.3 work CLOSED

studio-master-dev

studio-master-dev

studio-master-dev

The branches ub-tools-idea133 and ub-tools-master are deprecated. We are also not using master.

Development Branch

Like the Android operating system, Android Studio is open source and free of charge to all. Android releases source code to the Android Open Source Project (AOSP) after each stable release, described in detail here. As of Android Studio 1.4, Android Studio is aligning to the same model of releasing source code after each stable release. For those who contribute to Android Studio, the code contribution process is essentially the same as the Android platform. We expect to continue to release a stable version of Android Studio approximately every 2 -4 months, and at each of the these release the source code will be made available. Please continue to submit patches to the Android Studio AOSP branch. We will do code-reviews and merge changes into subsequent versions of Android Studio. We're incredibly grateful to all of you in the community for your collaboration and hard work on Android Studio.

Tags

The following release tags are available

studio-3.0

studio-2.3

studio-2.2

studio-2.0

studio-1.5

studio-1.4

...

And for gradle:

gradle_3.0.0

gradle_2.3.0

gradle_2.2.0

gradle_2.0.0

gradle_1.5.0

...

Doing a Checkout

First, you'll need to install the prerequisites for your platform. This means you'll have git, a C compiler, etc. There are quite a few steps here, and it's all platform dependent, so go to the official build instructions where we have detailed instructions: http://source.android.com/source/initializing.html.

Some of the requirements are not needed (case-sensitive file system for instance), unless you also plan on building the platform. If you're on Mac you will still need XCode to build the emulator.

Building

The parts of the SDK that can be build with the studio-* branches are only the IDE components and the SDK Tools. Each component is build differently due to varying build systems.

None of them uses the make-based build system of the platform.

Building Android Studio

Historically, building the Android tools required building the full Android SDK as well, since for example the emulator needed the system image.

However, we've been gradually migrating the tools source code over to a more independent setup, and you can now build the Android Studio IDE without a full Android checkout and without a C compiler etc. The instructions for building Android Studio are listed in the Building Android Studio page; the remainder of this document documents the process for building the rest of the tools (the Eclipse plugin, the emulator, etc.)

Full Windows SDK builds are only supported on Linux -- most of the framework is not designed to be built on Windows so technically the Windows SDK is build on top of a Linux SDK where a few binaries are replaced.

Setup:

$ sudo apt-get install mingw32 tofrodos

mingw32 is the cross-compiler, tofrodos adds a unix2dos command

To build:

$ . build/envsetup.sh$ lunch sdk-eng$ make win_sdk

Note that this will build both a Linux SDK then a Windows SDK. The result is located at
out/host/windows/sdk/android-sdk_eng.username_windows/