Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to navigate/view/edit android platform sources (AOSP) using Intellij IDE (Android Studio preferably)?

I like to view/edit android platform java code using Intellij IDE instead of eclipse.

Is it possible? If yes, any pointers up there on how to do this?

Thanks

like image 230
videoguy Avatar asked Jul 08 '13 21:07

videoguy


1 Answers

From AOSP root folder,

1) First build your target. That will generate whatever java files that need to be generated during aosp build. 2) Create a shadow dir of aosp dir using lndir. Assuming your aosp dir is ~john/work/aosp/ics. Then create ~/john/work/aosp/icsshadow

Cd to icsshadow and invoke "lndir ../ics". That will create symlinks to everything under ics.

3) Now you use icsshadow for all the stuff your IDE needs/generates. If you use ics folder, the aosp build some times fails if the IDE generates any build artifacts.

4) cd to icsshadow directory. Invoke development/tools/idegen/idegen.sh

Wait until it is done.

5) If you want to use IntelliJ, open android.ipr from icsshadow folder. If you want to use Eclipse, import .classpath from icsshadow folder.

For eclipse setup, please check Using eclipse to browse and edit AOSP.

like image 118
videoguy Avatar answered Sep 22 '22 12:09

videoguy