: Standard text search (like grep ) only matches strings. Xref tools analyze the abstract syntax tree (AST) of the code, allowing you to click on a function call and jump directly to its definition.
# On Ubuntu/Debian sudo apt install opengrok universal-ctags
Download the latest OpenGrok release binaries, extract them, and deploy the .war file to your Tomcat webapps directory. Step 3: Index Your Custom AOSP Source
refers to the cross-referenced code exploration environments used to navigate the massive Android Open Source Project (AOSP) codebase . Navigating AOSP manually is incredibly difficult because it contains hundreds of tightly integrated Git repositories managed by custom deployment tools like Google’s repo command. xref aosp
The need for dedicated xref tools arises from the sheer scale of AOSP:
If an API you rely on has changed, you can use Xref to find all instances of that function across the entire codebase to understand how to migrate your code. How to Use xref.aosp.org Effectively 1. Searching for Definitions and Usages
cd /path/to/aosp ctags --recurse --fields=+lnS --languages=C,C++,Java --exclude=out : Standard text search (like grep ) only matches strings
:
Now that you know the basics, let's move to advanced workflows that separate casual browsers from power users.
# Run from AOSP root make nothing # Or for a specific module mmm frameworks/native 2>&1 | tee compile_commands.json Step 3: Index Your Custom AOSP Source refers
While Google provides the official web tool, other resources exist for similar purposes: Tutorial: Diving into Android Source Code
“Towards Modernizing the Android Update System with Project Treble” (Google white paper style, but often discussed in academic venues like ACM MobiCom 2018 workshops)