Working with AOSP source within Android Studio

I regularly come across this requirement from my team members in particular those who happen to envy the fancy click-clicks of people working on standard Android app development. Most of my team actually works on the AOSP based sources itself. Well personally I still prefer editing in a simple text editor which provides just the basics required for the language of choice like Vim, Emacs or their GUI equivalents like Sublime.

For those who really want to explore the power of Android Studio on AOSP without it messing with the actual AOSP structure, just the run the following commands on the root directory of your AOSP setup.


. build/envsetup.sh (the regular environment set up stuff)
lunch (or pick your favorite lunch target)
make -j8 idegen (note the target here - idegen)
development/tools/idegen/idegen.sh (run a development script)

The final script run will generate a file named android.ipr file in main AOSP directory. Just open this file using Android Studio and voila!!

Statutory Warning at this junction: Android Studio will take quite some time in loading up this file as it is essentially a single project for the entire AOSP. As usual Android Studio will begin hogging up the entire system memory with the entire AOSP code index.

Most Important: This doesn’t get you anywhere in building entire Android using Studio. Its just a fancy IDE editing tool. Age old make is still your best friend.

Leave a Comment!

Your email address will not be published.

Related Posts