Search code examples
android-source

How to Update/Build/Compile an AOSP app from source


I am trying to learn about how to compile/change AOSP code and I am trying to start with making a change to the AOSP settings app. I already downloaded the android source and I tried opening the Settings application but when I open it in android studio its filled with errors and its like android studio does not recognize that it is an android application.

I do not intend on putting this on any device or anything I am just trying to understand how you would add something to the app. I am coming from normal everyday android development so I am sure dealing with aosp stuff is going to be different I just cant see to find a lot of information around this stuff

How does one go about making a change to an aosp app such as the settings app?


Solution

  • Settings app is a system app. It has access to system APIs and is signed with a system certificate. For this and some other reasons, it's not buildable outside AOSP build system. In other words, in order to build settings app, you need to build the whole system (and flash the whole image).

    If you're thinking of building it this way and just sideloading the app to your phone, it won't work either. The mentioned above certificate will not match system certificate on your phone. It needs to be flashed with entire system (with some exceptions that doesn't matter here).

    Having said that, give it a try! Building and flashing AOSP is a great way to learn. And not very difficult.