You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何单独编译Android模拟器中的android-emugl模块

How to Build the android-emugl Module Separately in the Android Emulator Codebase

Hey there! Let’s walk through exactly how to compile the android-emugl module on its own—no need to build the entire Android codebase. Here’s what you need to do:

Prerequisites

First, make sure you’ve already set up your Android source code environment:

  • You’ve run repo sync to pull the full emulator codebase
  • You’re working from the root directory of your Android source tree

Step-by-Step Build Process

  1. Load the build environment scripts
    Open your terminal and run this command to initialize the Android build system:

    source build/envsetup.sh
    

    This sets up all the necessary environment variables and helper commands you’ll need for building.

  2. Select your target device configuration (optional but recommended)
    Even though we’re building a single module, specifying a target ensures the build uses the right architecture and settings for the emulator. Run:

    lunch
    

    Then pick a target like sdk_phone_x86_64 (for 64-bit x86 emulators) or another emulator-compatible option from the list.

  3. Compile the android-emugl module
    You have two easy ways to do this:

    • Option 1: Build from the module directory
      Navigate to the android-emugl directory first:
      cd hardware/google/emugl/
      
      Then run the mm command (which builds all modules in the current directory):
      mm
      
    • Option 2: Build directly from the source root
      If you don’t want to change directories, use the mmm command followed by the module’s path:
      mmm hardware/google/emugl/
      

What Happens Next?

Once the build finishes successfully, you’ll find the compiled binaries and libraries in the out/target/product/<your-target>/obj/lib/ and out/target/product/<your-target>/system/lib/ directories (the exact location depends on the submodules within emugl).

Troubleshooting Tips

  • If you hit dependency errors, try running make clean in the emugl directory first, then re-run the build command.
  • For first-time builds, it’s normal to wait a bit longer as the system pulls and compiles any missing dependencies.

内容的提问来源于stack exchange,提问作者Michel Roger

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:46:32