GithubHelp home page GithubHelp logo

android-building-guide's Introduction

  • Pixel Experience 13 rom and lmi (Xiaomi Poco F2 Pro) are used as an example in this guide
  • As Pixel Experience is based off LineageOS, we have to use LOS based device and vendor trees. using AOSP based trees might have more errors upon compilation of the rom.
  • Have at least 300GB free space and 16GB RAM (with 20GB swap) for the build to succeed.

1) Set up your build environment in Ubuntu

# get superuser access.
sudo su

# install JDK 
add-apt-repository ppa:openjdk-r/ppa

# update all packages.
apt-get update

# install Java packages.
apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig

# become a normal user.
exit

# creating a bin folder and setting up AkhilNarang Script.
mkdir ~/bin
PATH=~/bin:$PATH
cd ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
git clone https://github.com/akhilnarang/scripts.git scripts
cd scripts
bash setup/android_build_env.sh

# now go back to parent directory (i just reopen terminal)

2) Enter your github details and download the rom source

# Connect your Github account.
git config --global user.name "FIRST_NAME LAST_NAME" 
git config --global user.email "YOUR EMAIL"

# we need to make a folder for the ROM first (Eg PE)
mkdir PE

# Go to ROM folder.
cd PE

# Now we need to initialize Pixel Experience Source (Eg 13 plus)
repo init -u https://github.com/PixelExperience/manifest -b thirteen-plus

# As an alternative you can do a shallow clone to reduce size of the source..
# A Shallow Clone only clones the source with the last commit history specified
repo init --depth=1 -u git://github.com/PixelExperience/manifest -b thirteen-plus

# And finally download the ROM source
repo sync

3) Download the necessary device trees

# Now open up file explorer and enable show hidden files if you haven't already

# Go to PE > .repo and create a new folder named "local_manifests"

# Download the file "lmi.xml" from this repo and place it inside this folder
# (you can customise this file to whichever trees you need for your device)
# (Minimally device, vendor and kernel trees are required)

# Sync the source again to download the device trees
repo sync

(For building new roms based on another rom's tree)

4) Build the rom!

# in the PE directory type
source build/envsetup.sh

# lunch it (romname_codename-userdebug depends on your AndroidProducts.mk name)
lunch aosp_lmi-userdebug

# build it
make -j2

# the make command above is for 16GB RAM peasant builders
# if you have plentiful amount of ram (>32GB) you can use this command instead to speed up build process
mka bacon

Your freshly built rom zip will be at romname/out/target/product/devicename ๐Ÿ‘

android-building-guide's People

Contributors

y0ngj1e avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.