Bare Minimum PC System Requirements:
CPU: Dual Core Intel® Pentium® Processor T4000
RAM: 4GB RAM
Storage: 70GB HDD
OS: Ubuntu 12.02 (Or any variant)
Network Speed: 2MBps
Recommended PC System Requirements:
CPU: Quad Core Intel® I5-3570 Processor
RAM: 8GB RAM
Storage: 200GB SSD
OS: Lubuntu 14.04 LTS (Or any variant)
Network Speed: 15MBps
Why do you need to be in the system requirements range?
> The system requirements are the bare minimum you need to have to build efficiently. Anything lower than the bare minimum will take the build more than 1 Day.
> We recommend utilizing SSDs as they are the most efficient at building due to its digital format rather than the traditional HDDs where it utilizes a spinning data disc.
> We recommend a network speed of 2MBps or more due to the size of android source code being more than 10GB of data. Anything lower will take you forever to download and may put you in a risk of data corruption.
> We recommend utilizing Higher Capacity SSDs as building android uses a lot of RAM and having more of this is handy when building.
We recommend utilizing CPUs with more cores as it helps the build process to be faster.
> We recommend using Ubuntu as it is the base standard for building Android ROMs. Any other ubuntu based distros should work with building Android.
Git can be considered as a project planner for code. It is a requirement to learn Git. To learn git, follow this guide.
REPO is a tool built by Google to work with GIT to download multiple repositories to your PC.
A repository can be considered as a container for a set of related code.
> Source Code
Source Code is made up of files that instructs different scripts to run to build a certain product specified. The rest of the source code is the resources needed to achieve this.
CCache is a method of utilizing a specified storage space to speed up building. It can be considered to be similar as the .odex files you find in Android.
Terminal is a requirement as it will be the 'nerve center' of your Android Building process
Nano is the Text Editor for Ubuntu.
The "$" sign in Linux/Ubuntu represents the start of a new line of code. Picture it as a full-stop in a sentence.
The term sudo is the way for defining root access in the terminal.
To build Android, we must install the proper drivers and software. Lets go through this step by step. From now on, anything that is highlighted ORANGE and is not a link will need you to modify it if required.
$ sudo apt-get update $ sudo apt-get install git $ git config --global user.name Your Name $ git config --global user.email email@example.com
$ sudo add-apt-repository ppa:phablet-team/tools $ sudo apt-get update $ sudo apt-get install android-tools-adb android-tools-fastboot
$ sudo apt-get install bison g++-multilib git gperf libxml2-utils
$ mkdir ~/bin $ PATH=~/bin:$PATH $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo
Now after choosing the Source Code you want, let's head over and prepare the repo to download their source code to your PC. Remember, URL for initializing the repo is always different so you'll need to refer and read the guide shown in their individual mini guides in the links shown above. For this moment, I'll be utilizing the source code found from Resurrection Remix.
Preparing REPO and initialize file directories
$ mkdir ~/android $ cd ~/android $ $ repo init -u https://github.com/ResurrectionRemix/platform_manifest.git -b lollipop
If you're reading this but don't want to build for Huashan, consult your respective developers at your device's xda forum
$ cd ~/android/.repo $ git clone https://github.com/Ultrax5/local_manifests.git $ cd ~/android
This will take a VERY long time and I probably recommend you go and do other entertaining things while this goes on.
$ cd ~/android $ repo sync -j8
For other devices, this will not be needed unless the developer states that a patch is required.
$ cd ~/android/device/sony/huashan/patches $ chmod 755 apply.sh $ ./apply.sh
Now to the most important part of the guide, BUILDING! If your PC hits the minimum requirements then it will build for about 4-6Hours while if your PC hits the Optimal Recommended Requirements, the build will take about 1Hour.
Obtaining Pre-Builts from CyanogenMod
Only use this if you choose a source that was based off CyanogenMod
$ cd ~/android/vendor/cm $ ./get-prebuilts
Change Huashan to your device code-name if you're building for other devices. It is recommended to take a look at the output as it may pin-point errors as they pop up.
$ cd ~/android $ . build/envsetup.sh $ brunch huashan
Congratulations on making it this far! Once the build process is completed with no errors do the following;
> Open up the file manager app of your choice
> Navigate to this directory; ~/android/out/product/huashan/theromzipwilllooklikethis_1242142132.zip
Once you've located the zip file, rejoice! You've successfully built a ROM direct from source! Now, you can flash the zip using your recovery and maybe even post it on XDA!
Thank you for following and reading the guide! If you post a ROM by using this guide, please do leave a credit for me and for those who didn't, leave a Thanks!
If you're ever wondering what my Build Environment is like, here's a look at my specs.
CPU: Intel I5 4670k
RAM: CORSAIR Vengeance 8GB
Storage: WD Black² Dual Drive
GPU: Asus GForce GTX 780 [Unimportant in Building]
Motherboard: ASRock 990FX Extreme9
PSU: RM Series™ RM1000
Casing: Cooler Master Cosmos II
[Yes I know, this build might be overkill but who cares :P]
- Other XSP Developers
- XDA Developers
- Cyanogenmod Build Guides
- Resurrection Remix Team