Android Studio For Platform (ASFP)

Got it. I’ll prepare a detailed, performance-optimized guide for viewing and navigating the full Android 15 AOSP codebase (around 100GB) in Android Studio for Platform on a 64 GB RAM Ubuntu system. This will include installation steps, efficient indexing and navigation strategies, and hardware/system optimizations to prevent lag. I’ll also explain how to keep this environment completely separate from your existing Android Studio installation for Kotlin development.

I’ll let you know once everything is ready.

Setup Android Studio for Platform on Ubuntu (AOSP navigation)

This guide shows how to install and configure Android Studio for Platform (ASfP) on Ubuntu for browsing the entire Android 15 (AOSP) source tree (≈100 GB) without building. We cover installation, project setup, IDE tuning for large projects, navigation shortcuts, system optimizations, and how to keep ASfP separate from your regular Android Studio.

1. Install Android Studio for Platform

  1. Download the ASfP package: Go to the Android Studio for Platform page and download the latest 64-bit Linux Debian package (e.g. asfp-ladybug-*.deb).

  2. Install the .deb: In a terminal, run:

    sudo dpkg -i /path/to/android-studio-for-platform-*.deb

    (Replace with the actual filename.) If there are missing dependencies, fix them with sudo apt-get -f install. This unpacks ASfP (typically to /opt/android-studio-for-platform by default).

  3. Run ASfP: Launch it with:

    /opt/android-studio-for-platform/bin/studio.sh

    On first run, decline to import settings from any existing Android Studio; start with a fresh profile. You can optionally create a desktop entry via Tools > Create Desktop Entry (name it distinctively, e.g. “Android Studio for Platform”).

2. Open the AOSP Project in ASfP

  • Create a new ASfP project: From the Welcome screen (or menu ASfP > Project > New Project… if ASfP is already open), select New Project. In the dialog, set the Repo path to your AOSP root directory (the top of the Android 15 source tree), choose the correct lunch target (e.g. aosp_cf_x86_64_phone-userdebug), and enter module paths to include (comma-separated). For example, you might include frameworks/base, system/core, packages/apps/Settings, etc., to cover core Java/C++ code. Give the project a name and click Finish. Screenshot: ASfP Import ASfP Project dialog (enter path, lunch target, modules, etc.).

  • Sync and index: ASfP will treat the project like a Soong workspace. It automatically invokes a Soong sync (akin to Gradle sync) and starts indexing the source files. Allow it to complete – this may take time for 100 GB of code.

  • Exclude unwanted code (optional): To reduce indexing load, edit the asfp-config.json at your project root. For example, you can add native exclusion rules:

    "nativeConfig": {
      "excludePaths": ["<path/to/skip>"],
      "excludeGenPaths": ["<gen/path/to/skip>"]
    }

    This tells ASfP to ignore specified directories (e.g. generated code or unused projects). (Use * wildcards if needed.)

3. IDE Configuration & Performance Tweaks

To make ASfP responsive on a huge codebase, adjust memory and indexing settings:

  • Increase IDE heap size: Go to File > Settings > Appearance & Behavior > System Settings > Memory Settings. Boost the IDE Max Heap and Gradle/Kotlin daemons as needed (on a 64 GB RAM machine, consider 8–16 GB for the IDE). ASfP will notify you if more memory is beneficial.

  • Edit VM Options: Via Help > Edit Custom VM Options, create an override studio.vmoptions and set -Xms/-Xmx (initial/maximum heap) and other JVM flags to match your system. For example:

    (Do not edit the file in the installation folder directly.)

  • Limit large-file indexing: In Help > Edit Custom Properties, create an idea.properties file and set limits. For example, add:

    This limits on-the-fly analysis for files larger than ~2.5 MB. Adjust as needed – setting it lower skips huge files entirely, setting higher (or removing it) enables assistance on big files.

  • Power Save Mode: Enable File > Power Save Mode to disable background inspections, error highlighting, auto-popup code completion, and background compilation. This dramatically reduces CPU/memory use when just browsing code.

  • Disable unneeded inspections: In File > Settings > Editor > Inspections, uncheck lint or analysis checks you don’t need. For example, Android/Gradle-specific inspections can be turned off for platform code.

  • Plugin management: Disable or uninstall plugins you won’t use (e.g. Android app or Flutter plugins if present) to save resources.

These tweaks minimize lag. Remember to restart ASfP after changing memory or VM options.

4. Efficient Code Navigation in ASfP

  • Project view: Open the Project tool window via View > Tool Windows > Project. This lets you browse the directory tree (unlike the “Android” view for apps, use the plain Project view).

  • Search Everywhere (⇧⇧): Press Shift twice quickly to search for any file, class, symbol, or IDE action by name. This is often the fastest way to jump to code.

  • Go to Class/File/Symbol: Use Ctrl+N (Class), Ctrl+Shift+N (File), or Ctrl+Alt+Shift+N (Symbol) to quickly open items by name. Wildcards work.

  • Navigate to Declaration: Ctrl+B or ⌘+Click lets you jump from a usage to its declaration. Use Alt+F7 or Ctrl+Shift+F7 to find usages of a method/class.

  • Recent and Favorite locations: Ctrl+E shows recent files, Ctrl+Shift+E shows recent locations. You can toggle bookmarks (F11) or add files to Favorites to mark important code.

  • Code structure: The Structure tool window (Alt+7) shows symbols in the current file for quick intra-file navigation.

Combine these with split views or multiple windows for large files. Familiarize yourself with IntelliJ/AS shortcuts (see IntelliJ IDEA Navigation).

5. System & Hardware Recommendations

For best performance on a 64 GB Ubuntu system:

  • Fast storage: Put the AOSP tree and ASfP IDE on an SSD (NVMe if possible). A fast filesystem (ext4 or f2fs) with noatime mount option reduces disk overhead. A dedicated drive for the source can speed up indexing. ASfP itself requires ~8 GB; the [docs recommend ≥16 GB SSD space].

  • Inotify watchers: Linux limits how many directories an IDE can watch. Increase it so ASfP can monitor the entire repo. For example:

    This raises the limit to ~1M watches and prevents ASfP from falling back to slow polling.

  • RAM & swap: With 64 GB RAM, swap can be modest (8–16 GB is usually enough) unless you need hibernation. On Ubuntu, you might create a 16 GB swapfile on your SSD. A small swap (or zswap) ensures the system remains stable if memory spikes.

  • CPU settings: For heavy indexing, set the CPU governor to performance (for example, sudo apt-get install cpufrequtils and sudo cpufreq-set -r -g performance). This avoids frequency scaling lags during indexing. ASfP will use multiple cores for indexing automatically.

  • Resource monitoring: Tools like htop can show CPU/memory usage. Avoid running other heavy tasks (like building the OS or other IDEs) simultaneously to keep ASfP responsive.

6. Keeping ASfP Separate from Android Studio

To ensure ASfP doesn’t interfere with an existing Android Studio setup:

  • Separate config and cache paths: ASfP (IntelliJ-based) supports custom paths. In Help > Edit Custom Properties, set properties like:

    This directs ASfP to use different config/cache folders. (Note: replace the path with your choice.)

  • Use STUDIO_PROPERTIES: You can launch ASfP with its own .properties file by setting the STUDIO_PROPERTIES environment variable to point to a custom file (e.g. ~/.android-studio-for-platform.properties). This file can contain the above idea.config.path overrides and any VM options.

  • Decline import: When running ASfP the first time, do not import settings from your regular Android Studio. This prevents mixing keymaps, themes, or plugins.

  • Distinct launcher entry: Name the desktop shortcut or menu entry something like Android Studio for Platform. Point it to the ASfP studio.sh. For example, in the created .desktop file set Name=Android Studio for Platform and Exec="/opt/android-studio-for-platform/bin/studio.sh" %f. This way you can run either IDE side-by-side without conflict.

By isolating settings and binaries, you can safely use ASfP for AOSP browsing while keeping your regular Android Studio untouched.


References: Official ASfP documentation and related resources were used for all recommendations.

Last updated