Sarthak Roy
hero

How to Setup AOSP Build Environment in Linux

Make sure you are running a Linux Operating System (Ubuntu is preferred)

Copy paste the following script to setup your build environment. Also make sure Add your git credentials by using
git config --global user.email "username@client.com"
git config --global user.name "Your Name"




Then Install the following packages.
sudo apt update
sudo apt install -y bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-gtk3-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev python ssh python2 patchelf binutils



Lets install Repo now
mkdir -p ~/.bin
PATH="${HOME}/.bin:${PATH}"
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
chmod a+rx ~/.bin/repo


Now we are done with all necessary stuff needed for building AOSP in Linux.