AIDEGen, presumably a shorthand for “Android IDE (helper) Generator”, is a tool in the AOSP source tree that allows working on system applications from within an IDE like Android Studio that is normally only configured for non-platform app development.
For more official information, see the AIDEGen README
:
Android 10, Android master.
The system-reserved com.android.internal
, SystemUI
etc. classes are not
exposed via the Android SDK for app developers, but rather listed in the
platform application’s Android.mk
or Android.bp
makefiles.
The aidegen
tool can bridge the gap from makefiles to IDEs and generate
configuration files with the resolved paths of the system classes and libraries
from a working AOSP tree.
Build AIDEGen:
. build/envsetup.sh
lunch aosp_x86-userdebug
m aidegen
The generated aidegen-dev
binary will be in
out/host/linux-x86/bin/aidegen-dev
.
Run it (you must be cd
’d to the root of the Android tree):
# Usage:
aidegen-dev [OPTIONS] $package_or_path
# Where $package can be a module name or $path can be, well, a path
# E.g.:
aidegen-dev -i s SystemUI
# Full command documentation:
aidegen-dev --help
A more practical example:
python3 out/soong/host/linux-x86/bin/aidegen-dev \
-n \ # Do not launch IDE
-s \ # Skip building jar/modules that create java files at build
packages/apps/Camera2
Full command reference of optional arguments, as of Android Q:
-h, --help show help message and exit
-d {0,1,2,3,4,5,6,7,8,9}, --depth {0,1,2,3,4,5,6,7,8,9}
The depth of module referenced by source.
-v, --verbose Display DEBUG level logging.
-i IDE, --ide IDE Launch IDE type:
j: IntelliJ,
s: Android Studio,
e: Eclipse.
-p IDE_INSTALLED_PATH, --ide-path IDE_INSTALLED_PATH
IDE installed path.
-n, --no_launch Do not launch IDE.
-r, --config-reset Reset all saved configurations,
e.g., preferred IDE version.
-s, --skip-build Skip building jar or modules that create
java files in build time, e.g. R/AIDL/Logtags.
-a, --android-tree Generate whole Android source tree
project file for IDE.
A good recommendation is to add the generated files to your .gitignore
:
#.gitignore
# Eclipse project
**/.classpath
**/.project
# IntelliJ project
**/.idea
**/*.iml
**/*.ipr
**/lib
**/gen
See also: