However, while there are many devices with LineageOS ports, there are even more without. In this quick and easy Appual’s guide, we’ll be showing you how to build LineageOS in a Windows 10 environment. Please note that this will not build a LineageOS ROM that is immediately compatible for your device, this guide is purely to get you setup and running on a Windows 10 environment for building LineageOS from the official Git repo. Please note you should be familiar with using Linux command terminals and building Android ROMs – this isn’t a beginner’s guide. You should see Appual’s guides on building custom ROMs from AOSP if you’ve never attempted to build a ROM before (links below). If you’re interested in custom ROM building and other DIY Android tutorials, you should check out these other Appual’s guides:

How to DIY Port TWRP for AndroidHow to Manually Theme Android System UIHow to Build a Custom ROM from AOSP | Pt. 2

Requirements:

Windows 10 (64-bit) (recommended to be installed on an SSD)At least 16GB of RAM (compiling takes a lot of resources!)

So what we’re basically going to do is set up a Windows Subsystem for Linux (WSL) for our build environment. This is incredibly easy though often overlooked, as most of what we need is available inside the Microsoft Store. Your first step is to open the Microsoft Store, and search for Ubuntu 18.04 and install the app. Next open the Ubuntu 18.04 app and go through the initial setup wizard. Now open the Ubuntu terminal and install the following packages: Next you need to create a new directory for the source code and navigate to it: Now we will init the LineageOS source repo: Add this bit of code to .repo/local_manifests/roomservice.xml (if this file doesn’t exist, you can simply create it) And we’ll download the source code: Now this is purely optional, but its recommended to turn on caching to speed up your build – we do this through “ccache”. You basically want to add the following line to your ~/.bashrc file: And then specify the maximum amount of disk space you want ccache to take advantage of: Replace the “50G” in that line with your preference – it corresponds to the amount of cache you’re allocating in gigabytes. If you’re building for just one device, you can use between 25G – 50G, but if you’re building for multiple devices that do not share the same kernel source you should bump it up to around 75 – 100G. In either case, utilizing the ccache will shave a significant amount of time off your builds. Next, you should cherrypick the following commit: Then you will prepare the device-specific code: Make 64-bit bison and ijar: Set the BISON_EXEC to run the 64-bit version of bison and set IJAR_EXEC to run the adapted ijar: (add the commands to ~/.bashrc if you don’t want to have to execute it every time you reopen a command line) And now you can start the build! For building in the future, you just need to repeat the steps of adding the .repo/local_manifests, enable the ccache, and set the BISON_EXEC and adapted IJAR. You also need to make bison && make ijar every time you flush the directory. Some final notes:

Do not add/edit your Linux files from Windows, the files will most likely become corrupted in bash. Do it within the Linux subsystem.Do not use mnt to download the source code to other drives and then follow this guide. You should download the source code to folders only within the Linux subsystem!

What Makes Lineage OS the Best for Android PhonesHow to Install Lineage OS on an Android Phone?Windows Terminal Finally Becomes The Default Windows 11 Command Line With New…Windows Defender Not Working in Latest Windows 11 Preview Build: Here’s How To… How to Build Lineage OS on Windows 10 - 51