# Setup IDE

AOSP includes a helpful package to do the job called [IDEGen](https://android.googlesource.com/platform/development/+/android-5.1.0_r1/tools/idegen/), which contains a series of scripts that will traverse your built sources and generate the project files. Yes, I said ***built*** sources…you have to build the target image first! There are several generated classes (AIDL stubs, resource files, etc.) that are needed to satisfly many of the cross-references.

The project has a handy README that explains all the details, but here it is spelled out:

```sh
source build/envsetup.sh
lunch aosp_x86-eng #(or pick your favorite lunch target)
make
mmm development/tools/idegen/
development/tools/idegen/idegen.sh
```

The first three steps just ensure that you have a built image ready…

The next step is to build the IDEGen module. This is the process that will fail if you don't have the proper intermediates in place first. Finally we run the generator script, which can take a few minutes to complete as it traverses the entire source tree.

### What are you left with?

The root of your AOSP tree will now have three new files in it:

* `.classpath` (Eclipse)
* `android.ipr` (IntelliJ / Android Studio)
* `android.iml` (IntelliJ / Android Studio)

Read More: <https://cs.android.com/android/platform/superproject/+/main:development/tools/idegen/>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.tejpratapsingh.com/android-tips/aosp/setup-ide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
