Xref Aosp 📢
Many developers new to AOSP try to grep -r through a local checkout. While possible, this approach has fatal flaws when working with AOSP:
Simply put: If you do any AOSP development or analysis, xref AOSP is your most essential daily tool.
Woboq is another popular C/C++ focused code browser often used to view AOSP native code due to its superior handling of C++ templates and inheritance diagrams. xref aosp
Because AOSP is huge, run xref from the root of your AOSP checkout:
cd ~/aosp
xref -f . --recursive --output ./xref_db
Note: This will take a while (30–60 minutes on a fast machine) and eat ~10–15 GB of disk. You can limit directories: Many developers new to AOSP try to grep
xref -f frameworks/base system/core --recursive --output ./xref_db
A classic approach for quick shell-based xref:
cd /path/to/aosp
ctags --recurse --fields=+lnS --languages=C,C++,Java --exclude=out
Then in Vim: Ctrl-] on any symbol jumps to its definition. Simply put: If you do any AOSP development
OpenGrok is the de facto standard for cross-referencing large codebases, widely used in the Java ecosystem and by internal teams at Google and Sun Microsystems before it. It is a fast, usable source code search and cross-reference engine.
The search box has two modes, toggled by icons:
Crucial Insight for "xref aosp" seekers: The symbol search is the xref. Text search is secondary.