[Guide] How to Setup Ubuntu 16.04 LTS xenial Xerus for compiling Android ROMs

Source: Internet
Author: User

With a new version of Ubuntu comes an update to my guide for setting up a build environment to compile Android ROMs. The aim of this was to simplify the configuration process and teach a little bit on the command line.

Follow the directions step-by-step. All of you has to do is copy and paste the code in order, it'll be ' up ' and running in no time!

This guide applies to all variations ofUbuntu 16.04 LTS xenial Xerus bit. do not useThe-- Bit version.

Also,Pay CLOSE ATTENTIONWhen to use "sudo"and when to not. It can cause unexpected issues if you do something as root so you shouldn ' t.

Much thanks goes out to Google, Protekk, Canonical, and everyone else which I read a random paragraph here and snippet ther E.

Ready to begin?

1) Unless it ' s a completely fresh Ubuntu installation, many people might has the wrong version of Java installed. Let's fix that first.

The command below makes sure you ' re starting with a clean slate. Copy and paste it into a terminal (Command prompt) window:

Code:
sudo apt-get remove openjdk-* icedtea-* icedtea6-*

If necessary, follow the on-screen instructions to remove any stray Java versions. Otherwise, move on to the next step.

2) Install The main build tools with this command:

Code:
sudo apt-get install openjdk-8-jdk git ccache automake lzop bison gperf build-essential Zip curl Zlib1g-dev Zlib1g-dev : i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush Schedtool Dpkg-dev Liblz4-tool make optipng maven

That's it on the side of things.

3) "Repo" communicates with GIT servers for all that precious source code. The next command would grab it:

Code:
mkdir ~/bin && Curl Http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo & & chmod a+x ~/bin/repo

4) Use your favorite text editor to open ~/.bashrc-i like Nano:

Code:
Nano ~/.BASHRC

5) at the very bottom (with the Page down key) paste this code to a new line:

Code:
export Path=~/bin: $PATH
Export use_ccache=1

6) Save it. In the nano that would is Ctrl-o and then Enter. Then Ctrl-x-to-exit back to a prompt. Restart bash:

Code:
Source ~/.BASHRC

7) in the terminal, navigate to where you would like to download the Android source code. The commands below would make it in your home folder and if you had limited space you could want to create it somewhere Els E. Faster is better, i.e. SSD would are best, USB external (even 3.0) would be comparatively slow. Here we go:

Code:
mkdir ~/android
CD ~/android

8) Now your ' re going to initialize the repo. This is where you decide the flavor of Android want to build, i.e. AOKP, CyanogenMod, AOSP etc.

For the purposes of this tutorial, here's the command for Cyanogenmod (Marshmallow):

Code:
repo init-u https://github.com/CyanogenMod/android.git-b cm-13.0

9) Last step. Time to get the source, many gigabytes of downloading await.

Don ' t worry, it ' s automated. It ' s The last one!

Code:
Repo Sync

Check back periodically every hour or so. It all depends in how fast your connection is.

That's should be everything. Now is ready to build Android. Good luck!

If This guide helped your out, feel free to click the thanks! button

Some ROMs require OpenJDK 7. Here's the easiest-to-install it on Ubuntu 16.04 since it's no longer in the main repositories.

First, add the PPA for OpenJDK:

Code:
sudo add-apt-repository ppa:openjdk-r/ppa

Then, install OpenJDK 7:

Code:
sudo apt-get update && sudo apt-get install openjdk-7-jdk

Finally, tell your system which version of Java and Java Compiler to use with the following commands. Enter each of the separately and make of the appropriate selection for OpenJDK 7:

Code:
sudo update-alternatives--config java
sudo update-alternatives--config javac

That ' s it! Everything should is ready to go.

http://forum.xda-developers.com/chef-central/android/guide-how-to-setup-ubuntu-16-04-lts-t3363669

Https://source.android.com/source/initializing.html

[Guide] how to Setup Ubuntu 16.04 LTS xenial Xerus for compiling Android ROMs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.