How To Build Lineageos Rom For Any Android Device Easily ! (Full Guide)
How To Build Lineageos Rom For Any Android Device Easily ! (Full Guide)
if [ -d "$HOME/platform-tools" ] ; then
PATH="$HOME/platform-tools:$PATH"
fi
Java
Different versions of LineageOS require different JDK (Java Development Kit) versions.
LineageOS 11.0-13.0: OpenJDK 1.7 (install openjdk-7-jdk) - for Ubuntu 16.04 and
newer, you can obtain OpenJDK 1.7 from the openjdk-r PPA.
LineageOS 14.1: OpenJDK 1.8 (install openjdk-8-jdk)
$ mkdir -p ~/android/system
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
123$ cd ~/android/system
The Lineage manifests include a sensible default configuration for repo, which we strongly
suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j
4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If
you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in
only the current branch, instead of the entire CM history.
Note: This may take a while, depending on your internet speed. Go and have a
beer/coffee/tea/nap in the meantime!
Tip: The repo sync command is used to update the latest source code from LineageOS
and Google. Remember it, as you can do it every few days to keep your code base fresh
and up-to-date.
Get prebuilt apps (Lineage 11 and below)
To download the prebuilt apps, run:
123$ cd ~/android/system/vendor/cm
$ ./get-prebuilts
You won’t see any confirmation- just another prompt. But this should cause some prebuilt
apps to be loaded and installed into the source code. Once completed, this does not need
to be done again.
$ breakfast manta
This will download your device’s device specific configuration and kernel.
Important: Some maintainers require a vendor directory to be populated before breakfast
will succeed. If you receive an error here about vendor makefiles, jump down to Extract
proprietary blobs. The first portion of breakfast should have succeded, and after completing
you can rerun breakfast
12$ ./extract-files.sh
The blobs should be pulled into the ~/android/system/vendor/samsung folder. If you see
“command not found” errors, adb may need to be placed in ~/bin.
and adding that line to your ~/.bashrc file. Then, specify the maximum amount of disk
space you want cache to use by typing this from the top of your Android tree:
where 50G corresponds to 50GB of cache. This needs to be run once. Anywhere from
25GB-100GB will result in very noticeably increased build speeds (for instance, a typical 1hr
build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is
fine. If you plan to build for several devices that do not share the same kernel source, aim
for 75GB-100GB. This space will be permanently occupied on your drive, so take this into
consideration. See more information about ccache on Google’s Android build environment
initialization page.
123$ croot
$ brunch manta
12$ cd $OUT
There you’ll find all the files that were created. The two files we’re interested in are:
1. recovery.img, which is the LineageOS recovery image.
2. lineage-13.0-20170122-UNOFFICIAL-manta.zip, which is the LineageOS installer
package.