Android Development – Compilation and building
In this last tutorial of the series I’ll show you how to build our final product, the custom ROM for our own device.
If you missed something…
- Android Development – Setting up the environment Part 1/3
- Android Development – Downloading sources Part 2/3
Last time, or at least if you have recovered from shock, we have downloaded CyanogenMod 14.0 sources and now we want to build our Cyano ROM too. Don’t you?
I just wanna remember you something before proceeding…
- You must have a good PC with at least 4 core CPU
- 4 is the minimum amount of GB RAM required
- 200gb of free hard drive space available
Note 1: compilation process is a really stressful operation that requires lot of power so it will always take your CPU at high frequencies and for this reason, I suggest you to cool it in someway or one day it will fry (not jocking, events like that have happened)
Note 2: It will stress your HDD too, it will do many read and write operations, so don’t scare if someday maybe after thousands compilations, your HDD dies. Consider to exclude to use an SSD, yes it would be much faster, but you will kill it earlier.
If it’s okay with specs, let’s start!
Move to you android directory, where you have previously downloaded the sources.
If your device is officially supported by the ROM mantainer, you just have to lunch and build, if not, things are harder (add device support, patching, etc..)
I assume that your device is supported, just like my LG G3, so:
lunch cm_d855-userdebug(the red part is your device codename, in my case is d855)
make otapackage -j#(number accrding to your PC cores)
Let’s explain something..
- lunch: this command is needed to setup all device configuration files; about the codename, you can easily find them in this article
- make: it creates the final .zip file which you will easily flash in your custom recovery, this is the long part but it may change according to your PC specs. If you have a modern hardware, you’ll do it in less than an hour.
When the process finishes, you will find a zip package in the out folder, but be careful, building is not as easy at it seems, you may have to solve compilation problems and so on, it depends on your device.
If you have problems, as always, you can contact us!