Build Guide

Updated for Android 10 (q)


This is the official guide to build BlissRoms for your device. In this guide, we will only cover official devices with actual maintainers. We will not delve into porting devices.

The golden rule to building is patience. If something breaks, wait for your maintainer to fix it, send a polite message to your maintainer, or better yet, try and fix it yourself. Then you can make a merge request and contribute!

Let’s get started.


To get started, you need a computer with Ubuntu 18.04 (LTS), at least 200GB space of HDD, and at least 8GB RAM. A decent CPU (or CPUs if you have a server motherboard) is recommended. Other distros can work but is not officially supported in this guide.

Underpowered machines may crash during compilation. If that happens, you may try and restart the build as most crashes are caused by lack of memory. If your storage space has run out, then you will need to build on a different hard drive.

Install the JDK

Install OpenJDK:

sudo apt install openjdk-8-jdk

Install build tools

To install the required build tools, run the following command:

sudo apt install git gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev lib32z1-dev ccache libgl1-mesa-dev libxml2 libxml2-utils xsltproc unzip squashfs-tools python python-mako libssl-dev ninja-build lunzip syslinux syslinux-utils gettext genisoimage bc xorriso liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk3.0-dev lzop maven pngcrush schedtool lib32readline-dev

Install source code tools

Now we need to get the source code via a program named repo, made by Google. The primary function of repo is to read a manifest file located in BlissRoms's GitHub organization, and find what repositories you need to actually build Android.

Create a ~/bin directory for repo:

mkdir -p ~/bin

The -p flag instructs mkdir to only create the directory if it does not exist in the first place. Now download the repo tool into ~/bin:

curl > ~/bin/repo

Make repo executable:

chmod a+x ~/bin/repo

And add it to PATH:

nano .bashrc

Scroll to the end of the file and type these lines:

# Export ~/bin
export PATH=~/bin:$PATH

Ctrl-O and enter to save, then Ctrl-X to exit nano. Now either logout and login again (or reboot), or source the file:

source .bashrc

Which can be shortened to:

. .bashrc

What is source?

source is a bash command to read aliases, functions, and commands from the specified file. Typically, you'll supply bash with a configuration file such as .bashrc or .bash_profile, or an initialization file such as The difference is that while the configuration file lists configuration and user-defined aliases and functions, initialization files typically hold build commands such as breakfast, brunch, and lunch. Without those commands building would be significantly harder as you would have to memorize the long command to invoke a build manually!

But why do you need to run it after modifying a file? Well, bash cannot automatically detect changes in our files. To solve this, we either source it or log out and log back in, forcing bash to reload configuration files. Keep this in mind, because unlike configuration files, if you forget to source initialization files, build commands will not function!

What if I need repo globally?

If you need the repo tool to be available anywhere, you will need to first download repo to your home directory, move it with sudo and give it executable permissions. The exact commands are as follows:

curl > ~/repo
sudo mv ~/repo /usr/bin/
chmod a+x /usr/bin/repo

repo will now work anywhere, without any .bashrc modifications. However, these steps aren’t recommended as repo might become a security risk if a vulnerability is found.

Now we’re ready to download the source code.


Create a directory for the source:

mkdir -p ~/bliss/q
cd ~/bliss/q

Before we download, we need to tell repo and git who we are. Run the following commands, substituting your information:

git config --global “”
git config --global “Randy McRandyface”

Now, we’re ready to initialize. We need to tell repo which manifest to read:

repo init -u -b q

-b is for the branch, and we’re on q, Android 10. It’ll take a couple of seconds. You may need to type y for the color prompt.

Then sync the source:

repo sync -j24 -c

-j is for threads. Typically, your CPU core count is your thread count, unless you’re using an older Intel CPU with hyperthreading. In that case, the thread count is double the count of your CPU cores. Newer CPUs have dropped hyperthreading unless you have the i9, so check how many threads you have. If you have four threads, you would run:

repo sync -j4 -c

-c is for pulling in only the current branch, instead of the entire history. This is useful if you need the downloads fast and don’t want the entire history to be downloaded. This is used by default unless specified otherwise.

I still don't know how much CPU threads I have. How do I check?

Run nproc. The output should be something like this:

rwaterspf1@test:~$ nproc

This means that there are 24 threads in your machine.

repo will start downloading all the code. That’s going to be slow, even on a fiber network. Expect downloads to take more than a couple hours.


Set up the build environment:

. build/

This is the initialization file we talked about earlier up top. This "initializes" the environment, and imports a bunch of useful build commands required to build your device. Again, you need to remember to source this file every time you log out and log back in, or launch a new bash/Terminal instance.

Define what device you’re going to build. For example, the Nexus 5X, has a codename of bullhead. You can check your specific device's codename on GitHub or on Google. Execute:

breakfast bullhead

What does this do? breakfast searches repositories for your device "tree", which contains all the details needed to make the build suitable for your device. CPU, kernel info, device screen size, whether the board has Bluetooth, NFC, what frequencies the build needs for Wi-Fi, and a bunch of other things. breakfast will automatically search in the BlissRoms-Devices GitHub repository, and grab your device tree for you.

Okay, so we have the device tree set up. Feel free to browse around the source code to see what changed. You should see folders added to device/, kernel/ and vendor/. A shortcut:


will dump you back in the root of the source code tree. So if you’ve been going through folders and don’t have any idea where you are, you can use the above command. This command, however, requires you to have sourced build/ earlier.

We're ready to build, but before we teach you the easy command to execute a build, we will first try the manual method. To set up the current terminal environment for building your particular device, execute:

lunch bliss_bullhead-userdebug

Let's break down the command. lunch initializes the proper environmental variables required for the build tools to build your specific device. Things like BLISS_DEVICE and other variables are set in this stage, and the changed variables will be shown as output. bliss_ is the ROM that we are building. As convention, all devices will have this prefix. bullhead is the specific device we are building - in this case, the Nexus 5X. Finally, userdebug means that we will build a user-debuggable variant. This is usually what most ROMs use for publishing their builds. Manufacturers typically use user which disables most of the useful Android Logcats.

My device isn't booting, and userdebug won't print any adb logcats. What gives?

There is a third build variant called eng, short for engineering builds. These builds will activate adb logcat during boot, and will show you exactly what is going wrong, where, and why. However, these builds are NOT recommended for normal usage as they are not securely hardened, have log spam that will slow down your device, and other unexpected problems like userspace utilities crashing during runtime. If you want to submit your device for mainline, do NOT submit an eng build!

All set? Let's start the building process. Run:

mka blissify

And the build should start. The build process will take a long time. Prepare to wait a few hours, even on a decent machine.

Why mka and not make?

make only runs with 1 thread. mka is properly aliased to use all of your threads by checking nproc.

If you want to customize your thread count (maybe you're building with a fan-screaming laptop in a quiet coffee shop), use make blissify -j#, replacing the hash with the number of threads (example of make blissify -j4).

I get an error about no blissify targets to build against, what's wrong?

If you are building other ROMs, it is usually make bacon. For BlissRoms, we chose the build target of blissify. If that doesn't work, sometimes there is a bug, or the ROM developers do not implement a bacon target to build against. In this case, you will need to find what name they use to initialize a full build of the ROM. Conventionally, it is supposed to be bacon, but some ROM developers change this name inadvertently, or actually have a bug that causes the build target to never be found. If you cannot locate the build target, ask the developers of the ROM. Alternatively, you can try poking around in build/make/core/Makefile to see what the build target name is. But this is out of the scope of this article as you're not supposed to be building other ROMs (that's not what this tutorial is for, sorry!)

All right, but that's annoying. You had to type three commands to build it all. What about running one command?

blissify bullhead

But what is blissify? It is a compact form of these commands:

breakfast bullhead
lunch bliss_bullhead-userdebug
make blissify

Sounds great, right? Once you have run the command, jump over to the next section.

After building

There are two outcomes to a build - either it fails and you get a red error message from make, or it succeeds and you see the Bliss logo in ASCII. If you encounter the former, you need to go back and fix whatever it's complaining about. Typically, 90% of the time the problem will be in your device tree. For the other 10%, submit a bug report to the ROM developers. Be sure to include the full log of your build to help diagnose the problem, and your device tree.

If you face the latter, congratulations! You've successfully built BlissRoms for your device. Grab the artifacts for your device:

cd out/target/product/bullhead/

In here, you’ll find a .zip that goes along the lines of Install TWRP, flash the build to your device, and enjoy!


If your build failed, there are a couple things you can try.

  • Try a fresh repo sync to make your repository up to date. Sometimes, the Internet connection between you and GitHub can be flaky. In rare cases a commit merge might be ongoing, and you might've grabbed an incomplete merge. Mostly, this should fix the issue 70% of the time.
  • Make sure your dependencies are installed correctly. Error messages help out a lot here! Often it will say shared/linked library not found or something along those lines.
  • Make sure you sourced build/ This is especially common and worth suspecting if none of the build commands like breakfast and lunch work. If you have repo synced do this again.
  • Make sure you’re at the root of the build tree. Again, to quickly jump there, use croot.
  • Make sure you ran breakfast correctly and it did not error out. Missing device files will prevent successful builds.
  • Make sure your computer itself isn’t faulty. HDDs usually die first, followed by RAM. SSDs rarely die but failure is not unheard of. In extremely rare cases, your CPU may have a defect. If you're unsure, run a stress test using a program like Prime95.

If something goes wrong and you've tried everything above, first use Google to look up your error! Most of the errors you encounter is due to misconfiguration and wrong commands entered. More often than not, Google will have the answer you are looking for. If you're still stuck and nothing fixes the problem, then ask us via our Telegram Build Support chat.


Building a ROM is very hard and tedious and the results are very rewarding! If you managed to follow along, congratulations!

After you finish building, you can try out the Git Started guide. Make changes, commit, and send them off to our Gerrit for review! Or better yet, download experimental commits not ready for the mainline repositories and review them! Again, ROM building is a fun project you can work with. I hope this guide was a lot of fun to run through!

-- Eric Park (ideaman924)

Looking for the next tutorial?

Check out some tips to optimize your build experience.