User-agent: Mediapartners-Google Disallow: User-agent: * Disallow: /search Allow: / Sitemap: http://nano7mobile.blogspot.com/sitemap.xml Nano Mobile: [Guide] How to build from Android Source Code topic

[Guide] How to build from Android Source Code topic








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?

Quote:









> 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.




Understanding different terms

Quote:









> GIT
Git can be considered as a project planner for code. It is a requirement to learn Git. To learn git, follow this guide.
> REPO
REPO is a tool built by Google to work with GIT to download multiple repositories to your PC.
> Repositories
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
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
Terminal is a requirement as it will be the 'nerve center' of your Android Building process
> Nano
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.
> sudo
The term sudo is the way for defining root access in the terminal.




Preparing Ubuntu

Quote:









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.

Installing Git:

Code:


$ sudo apt-get update
$ sudo apt-get install git
$ git config --global user.name Your Name
$ git config --global user.email youremail@googlotmail.com


Installing ADB and Fastboot:

Code:


$ sudo add-apt-repository ppa:phablet-team/tools
$ sudo apt-get update
$ sudo apt-get install android-tools-adb android-tools-fastboot


Installing Building Software:

Code:


$ sudo apt-get install bison g++-multilib git gperf libxml2-utils

Installing Repo:

Code:


$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo







Choosing your Source Code

Quote:









To build Android, we must choose the Source Code provider. I'll list the one's I can find below:




Syncing Source Code

Quote:









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

Code:


$ mkdir ~/android
$ cd ~/android
$ $  repo init -u https://github.com/ResurrectionRemix/platform_manifest.git -b lollipop


Modifying repo to download source for our device
If you're reading this but don't want to build for Huashan, consult your respective developers at your device's xda forum

Code:


$ cd ~/android/.repo
$ git clone https://github.com/Ultrax5/local_manifests.git
$ cd ~/android


Downloading Source Code
This will take a VERY long time and I probably recommend you go and do other entertaining things while this goes on.

Code:


$ cd ~/android
$ repo sync -j8







Applying the necessary patches

Quote:









For other devices, this will not be needed unless the developer states that a patch is required.

Code:


$ cd ~/android/device/sony/huashan/patches
$ chmod 755 apply.sh
$ ./apply.sh







Building Android

Quote:









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

Code:


$ cd ~/android/vendor/cm
$ ./get-prebuilts


Building Android
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.

Code:


$ cd ~/android
$ . build/envsetup.sh
$ brunch huashan







Obtaining the Final Product

Quote:









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!




Epilogue

Quote:









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! :D

If you're ever wondering what my Build Environment is like, here's a look at my specs.




PC TYPE: Custom Desktop
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]






Credits
  1. NexusPrime

  2. MrSteve555

  3. Pec0ra

  4. Other XSP Developers

  5. XDA Developers

  6. Cyanogenmod Build Guides

  7. Resurrection Remix Team







Aucun commentaire:

Enregistrer un commentaire