How To Build Android Rom In Windows
If you're familiar with rooting your Android telephone or downloading custom ROMs, such as the highly pop CyanogenMod or its successor Lineage Bone, you may accept wondered – how practice people build these ROMs? How much work exactly goes into developing a customized ROM?
This guide will walk y'all through the basics of developing your own custom Android ROM. Information technology should be noted that this is a massive undertaking – if you lot have nil experience in coding or fooling around in Linux terminals, yous may want to get some cognition under your belt before diving into this deep-end. But if y'all have at least a basic thought of those things, I will try to explicate things as simply every bit possible, so you can follow along.
Basically what we're doing is downloading the raw Android source code (AOSP) and modifying it to our liking. Because there are so many sources to choose from for different devices, this guide will simply reference the master source known as AOSP (Android Open Source Projection).
Now the matter almost the AOSP is that the pure source lawmaking does not include device-specific hardware proprieties. In layman'due south terms, hardware like your camera and GPU volition not work "out of the box" when developing with the AOSP. In fact, your device will not even boot without these hardware binaries.
If you're developing for a Google-branded telephone (Pixel, Nexus, etc) you can find the hardware binaries directly from Google, and this guide will walk yous through obtaining and building them into your ROM. However, if you're developing a ROM for a make-name phone (Sony, Samsung, etc)… well, anoint your heart, because you're in for a ride.
Some manufacturers accept their own open-source projects or release evolution tools for would-be developers, whereas other manufacturers keep a tight hat on their proprietary codes. Hither's a cursory list of open-source projects from the more pop manufacturers:
Samsung Open Source Release Middle
Sony Developer World
Lenovo Support
Huawei Open up Source Release Heart
Motorola Developers
With that out of the style, permit'southward continue under the assumption nosotros are building a ROM for the most basic, vanilla Android experience, for a Google Pixel device. With this cognition under your belt, yous'll be able to co-operative out on your ain and get-go developing customized versions of specific manufacturer's ROMs.
Requirements for this Guide:
- Android Open Source Project
- Pixel Twoscore phone or an Android emulator for Linux
- 64-scrap Linux Operating System – Ubuntu or Linux Mint are the most newbie-friendly distros, whereas BBQLinux was developed specifically with Android developers in listen.
- Python
- A beefy figurer (compiling code takes a lot of memory and infinite!)
Setting Upward Your Build Environment
Let's begin past setting up the Android emulator on your Linux machine. Whether or not yous accept a Google Pixel XL device, it's always safest to try your new ROM on an Android emulator before flashing it to your device. My personal favorite is Genymotion, so I'll walk you lot through installing that item emulator. However, you can also check out this guide "Best Android Emulators", as well-nigh of them as well accept Linux compatibility.
Head over to the Genymotion website, register an account, verify it through e-mail, and download the executable to your Linux desktop.
Now open a Linux terminal, and blazon:
Chmod +x genymotion-xxxxx.bin (replace xxxx with the version number in the filename)
./genymotion-xxxxxx.bin
Press Y to create the Genymotion directory. Now type in the last:
cd genymotion && ./genymotion
Now information technology will ask you to begin the installation process, then just keep clicking Next until you lot get to the Add Virtual Devices window. Select "Pixel XL" under Device Model option, and and then consummate the installation. You can exam the virtual device out if yous desire, information technology volition basically be like having a Pixel XL phone on your desktop.
Let'south at present set Python:
$ apt-become install python
At present we need to setup the Java Development Kit on your Linux auto. Open the Linux terminal and type the following commands:
$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk
Now you lot will need to configure the Linux system to allow USB device access. Run the following code in the Linux last:
This volition download the required 51-android.txt file that allows the same USB device access. Open the .txt file and modify information technology to include your Linux username, so place the .txt file in the following location: (as the root user). Now plug your device into your computer via USB for the new rules to automatically take event.
Downloading the Android Source
The AOSP is hosted on Git, so we're going to utilise a tool chosen Repo to communicate with Git.
First we need to setup a /bin folder in your Home directory. Type the following commands into the Linux final:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
Now we will download the Repo tool, so type into the Linux final:
$ coil https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Afterward Repo is installed, we must at present create an empty directory to hold your work files. So type this into the Linux terminal:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
Now we'll configure Git with your name and email address – utilize a Gmail address that you cheque regularly, otherwise y'all will not be able to apply the Gerrit code-review tool.
$ git config –global user.proper noun "Your Proper name"
$ git config –global user.e-mail you lot@gmail.com
Now we'll tell Repo to pull the latest principal manifest of AOSP from Git:
$ repo init -u https://android.googlesource.com/platform/manifest
If done successfully, you'll receive a message that Repo has been initialized in your working directory. You'll too observe a ".repo" directory within the client directory. And so at present nosotros'll download the Android source tree with:
$ repo sync
Building the Android Source
This is where the hardware binaries mentioned at the beginning of this guide come into play. Let'south caput over to the AOSP drivers page and download the Pixel 40 binaries for Android 7.ane.0 (NDE63P). You want to download both the vendor image and the hardware components. These come as compressed archives, so excerpt them to your desktop and run the cocky-extracting script from the root folder. Cull to install the binaries to the root of the WORKING_DIRECTORY nosotros created before.
Now type into your Linux terminal:
$ brand clobber
$ source build/envsetup.sh
Now nosotros'll choose the target to build, then blazon:
$ lunch aosp_marlin-userdebug
$ setpaths
$ make –j4
At that place, we have now "built" an Android ROM from source. So allow's test it in the emulator, past typing into the final:
$ emulator
So play effectually in the emulator a chip. As y'all tin see, a purely vanilla Android experience is quite minimal, and this is why manufacturers customize the AOSP to their needs. So y'all could flash this ROM we just built to your device if you wanted, but without calculation any enhancements, a purely vanilla Android feel would be a very slow matter indeed.
And then what manufacturers volition typically do with the AOSP is fork it, add their own proprietary binaries, customize the UI, add a boot logo, etc. Manufacturer'south basically just paint over the stock Android ROM, and so that will exist your next goal too.
Stay tuned, equally the second part of this guide will go through adding fonts, themes, and a kicking animation to your ROM!
How To Build Android Rom In Windows,
Source: https://appuals.com/build-custom-rom-android-open-source-project/
Posted by: perezhaved1949.blogspot.com
0 Response to "How To Build Android Rom In Windows"
Post a Comment