keyboard_arrow_left Back to the overview

How to import the sources to Android Studio

Install Android Studio for Platform

Go to the Download page and download the package. Follow Google’s instructions to setup and run the IDE.

Alternatively, you can check if your distribution has this available as a package and install it through their package manager. Make sure you are not installing the regular “Android Studio”, which lacks platform development support.

Start working with Android Studio for Platform

Open Android Studio and click on Import Asfp Project. On newer versions (such as 2024.1), press “New” and it will create a new ASfP project.

Then set the Repo checkout to your Android source directory.

Set your lunch target to the device you want to build in this format: lineage_<device>-<release version>-userdebug (e.g. lineage_arm64-ap4a-userdebug), replacing the missing values in brackets accordingly. Check our list of devices to get started.

If there are any modules you want to work on, you must specify them as module paths. By default, Android Studio will not open any paths.

Start developing

Now, after all the previous steps are done, you can actually start developing and exploring the sources. The Find in path function (Edit -> Find -> Find in path) can be a good start to find a file you want to modify. Just search for a known string among all source files and then dive in deeper until you actually found the function you want to modify.

Contribute!

After you have modified the sources and tested your change, you can contribute to LineageOS by submitting your work.