This guide will help you set up and build the Android Emulator on your Linux machine for development.
The instructions here assume you are using a deb based distribution, such as Debian, Ubuntu or Goobuntu.
Install the following dependencies:
sudo apt-get install -y git build-essential python3 qemu-kvm ninja-build python-pip ccache cmake
Install Repo:
mkdir $HOME/bin curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > $HOME/bin/repo chmod 700 $HOME/bin/repo export PATH=$PATH:$HOME/bin
Add export PATH=$PATH:$HOME/bin to your .bashrc or .zshrc file.
Initialize Repo:
mkdir -p $HOME/emu-master-dev && cd $HOME/emu-master-dev repo init -u https://android.googlesource.com/platform/manifest -b emu-master-dev
Download Code:
repo sync -j 8
Build:
cd external/qemu && android/rebuild.sh
List Available Virtual Devices:
./objs/emulator -list-avds
Incremental Builds:
ninja -C objs
Configuring the build:
You can get additional information on how to configure the build by running:
android/rebuild.sh --help
For example ./android/rebuild.sh --task CTest will run all the unit tests
Running unit tests:
We use ctest to run unit tests. You can run them in the objs directory
cd objs; ctest -j 10
You can obtain the latest build of the emulator from our build servers. Look for the sdk-repo-{architecture}-emulator-{buildid}.zip artifact.
Here you can find details on submitting patches.