AOSP setup on Ubuntu machine

More than 100Gb source code becomes 250Gb+ after compilation…. that’s AOSP

#AOSP recommended computer configuration

  • Android AOSP is approximately 100GB code in today (2020) but after compilation and build it grows around 250GB.
    1. Processor — i5 /i7 latest generation
    2. Ram — 16Gb minimum (for less ram it will take a lot of time to compile full OS )
    2. OS — prefer Ubuntu latest version because the android team itself tests on Ubuntu and Mac Pc’s.

NOTE — Here onwards we have used ($:) symbol for showing ubuntu terminal. Commands start after that symbol.

# Installing essential packages
On Ubuntu to compile and build, it needs few packages with should be installed so just put the following command in terminal and it will setup all the environment needed.

$: sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip gtkterm adb uuid uuid-dev zlib1g-dev liblz-dev liblzo2–2 liblzo2-dev lzop git-core curl u-boot-tools mtd-utils android-tools-fsutils openjdk-8-jdk device-tree-compiler gdisk m4 libz-dev

# Install python mako module
$: sudo apt-get install python-mako

# Install OpenJDK8
$: sudo add-apt-repository ppa:openjdk-r/ppa
$: sudo apt-get update
$: sudo apt-get install openjdk-8-jdk
$: sudo update-alternatives — config java
$: sudo update-alternatives — config javac

# installing git and repo
$: sudo apt-get install git
$: sudo apt-get install repo

# configure git

$: git config — global user.email “myemail@email.com
$: git config — global user.name “username”

#For e.g.
git config — global user.email “param@gmail.com” <br/>
git config — global user.name “param”

# To use this manifest repo, the ‘repo’ tool must be installed first.
$: mkdir ~/bin
$: curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$: chmod a+x ~/bin/repo
$: export PATH=${PATH}:~/bin

# Actual downloading AOSP Code
$: repo init -u https://android.googlesource.com/platform/manifest -b android-9.0.0_r45
$: repo sync

- NOTE -Downloading will take ~6–7 Hours based on Internet Speed and compilation will take ~6–7 Hours based on computers ram and processor speed.

# Next Reading
- Before going to the compilation and building the AOSP let's understand the repo commands to handle the source code in the next chapter Compile and Build AOSP code.

>>>

Software Engineer. (Mobile and Web)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store