> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devinenterprise.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Android emulator support

> Build and run Android applications on a full emulator running on Devin's own machine

Devin can build and run Android applications directly on its own machine — giving it the Android equivalent of [Computer Use](/work-with-devin/computer-use) and browser interaction. Devin can open the app, inspect behavior, reproduce issues, and verify changes in the environment where the application actually runs. Combined with [video recordings](/work-with-devin/testing-and-recordings), Devin can send you a recording as proof.

## What You Can Do

With Android emulator support enabled, Devin can handle the full mobile development loop:

<CardGroup cols={2}>
  <Card title="Build & smoke-test PRs" icon="hammer">
    Devin builds and runs your app on the emulator, then clicks through critical flows after each PR. You get a video recording that proves the feature works — watch it and merge.
  </Card>

  <Card title="End-to-end mobile testing" icon="mobile">
    Test complete user flows — login, navigation, form submission, checkout — on a real Android stack, not a mock. Devin follows the flow step-by-step and flags anything that breaks.
  </Card>

  <Card title="UI verification" icon="eye">
    Verify layouts, themes, and responsiveness across screen sizes and API levels. Devin takes screenshots at key points and flags visual issues like overlapping elements or clipped text.
  </Card>

  <Card title="Debug crashes & ANRs" icon="bug">
    Reproduce issues on the emulator, capture `logcat` output, inspect behavior, trace the root cause, and push a fix — all in one session.
  </Card>

  <Card title="Cross-platform validation" icon="arrows-left-right">
    Building with React Native, Flutter, or Kotlin Multiplatform? Devin can test the Android side alongside your web or desktop builds in the same session.
  </Card>

  <Card title="Instrumented test execution" icon="flask-vial">
    Run Espresso or UI Automator test suites on the emulator and get results reported back, without needing a separate CI device farm or physical devices.
  </Card>

  <Card title="Multi-config testing" icon="layer-group">
    Verify your app across different API levels or device profiles by configuring multiple AVDs. Useful for catching compatibility issues before they reach users.
  </Card>
</CardGroup>

## How It Works

Android emulator support is built on the same [declarative configuration](/onboard-devin/environment/blueprints) system as the rest of Devin's environment. You add the Android SDK and emulator to your blueprint, and Devin's snapshot builds a VM with everything pre-installed. Every session boots from that snapshot with the emulator ready to go.

During a session, Devin interacts with the emulator in two ways:

| Method                     | What it does                                                  | When to use it                                               |
| -------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------ |
| **`adb`** (command line)   | Install APKs, run tests, capture logs, take screenshots       | Automated builds, instrumented tests, logcat debugging       |
| **Computer Use** (desktop) | Tap, swipe, type, and navigate the emulator's screen visually | End-to-end UI testing, visual verification, video recordings |

The emulator window runs on Devin's desktop, so you can watch Devin interact with your app in real time via the **Desktop** tab in the webapp.

## Setting Up the Emulator

<Tabs>
  <Tab title="Let Devin do it (recommended)">
    The easiest way to get started. Devin analyzes your Android project, installs the right SDK components, and configures the emulator for you.

    <Steps>
      <Step title="Start a Devin session">
        Open a new session and ask Devin to set up Android emulation. For example: *"Set up an Android emulator for this repo."*
      </Step>

      <Step title="Review and approve">
        Devin proposes a blueprint with the Android SDK, build tools, and emulator configuration. Review the suggestion cards in your timeline and click **Approve**.
      </Step>

      <Step title="Verify">
        Once the build completes, start a new session. Ask Devin to build and run your app on the emulator to confirm everything works.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Manual blueprint setup">
    If you know exactly what SDK components and emulator configuration you need, you can write the blueprint yourself.

    <Steps>
      <Step title="Navigate to environment configuration">
        Go to **Settings > Environment > Blueprints** and select your Android repository.
      </Step>

      <Step title="Write your blueprint">
        Add the Android SDK, platform tools, emulator, and a system image to `initialize`. Add your dependency install to `maintenance`. See the [blueprint examples](#blueprint-examples) below for copy-paste templates.
      </Step>

      <Step title="Save and build">
        Click **Save**. A build starts automatically (typically 5–15 minutes for Android due to SDK downloads). Monitor progress from **Settings > Environment > Snapshots**.
      </Step>

      <Step title="Verify">
        Once the build shows **Success**, start a new session. Ask Devin to launch the emulator and build your app to verify.
      </Step>
    </Steps>
  </Tab>
</Tabs>

### What gets installed

A typical Android emulator support blueprint installs:

| Component                       | Purpose                                     |
| ------------------------------- | ------------------------------------------- |
| Android SDK command-line tools  | Core SDK management (`sdkmanager`)          |
| Platform tools                  | `adb`, `fastboot` for device communication  |
| Build tools                     | `aapt2`, `d8`, `zipalign` for building APKs |
| Android platform (e.g., API 34) | Target API level for your app               |
| Emulator + system image         | The virtual device itself                   |

<Tip>
  Use an `x86_64` system image for best performance inside Devin's environment. ARM images work but are significantly slower under emulation.
</Tip>

## Using the Emulator

### On-demand testing

Ask Devin to build and run your app at any point during a session — no special syntax needed, just natural language:

* *"Build and run the app on the Android emulator"*
* *"Test the login flow on the emulator and send me a recording"*
* *"Open the settings screen on the emulator and verify the new toggle appears"*
* *"Run the Espresso tests on the emulator and show me the results"*

Devin will launch the emulator (if it isn't already running), build and run your app, and interact with it — using `adb` for programmatic actions and Computer Use for visual interactions.

### Integration with Testing & Recordings

Android emulator support plugs directly into Devin's [Testing & Recordings](/work-with-devin/testing-and-recordings) workflow. After creating a PR:

1. Devin offers to **Test the app** — click the button or ask directly
2. Devin builds and runs the app on the emulator and executes a focused test plan
3. The emulator screen is captured in a **video recording** with annotations
4. The recording is sent to you so you can watch the test and merge with confidence

This works the same way as web app testing — the only difference is that Devin interacts with the emulator window instead of Chrome.

<Tip>
  Create a [Skill](/product-guides/skills) that tells Devin exactly how to build, launch, and test your Android app. This saves setup time on repeat sessions and ensures consistent testing. For example, include the Gradle build command, which activity to launch, and which flows to verify.
</Tip>

### Skill suggestions

After testing your Android app, Devin writes down what it learned — how to start the emulator, which Gradle tasks to run, how to navigate to the feature under test — and proposes creating or updating a [Skill](/product-guides/skills) via PR. You can merge the PR as-is or tweak it to refine the instructions.

Over time, this means Devin gets better at testing your Android project. Each session's learnings build on the last — so the second time Devin tests your app, it already knows how to build it, which activity to launch, and which flows matter most.

You can also prompt Devin to do this at any time (e.g., *"create a skill for how to build and test this Android app"*). See the [Skills guide](/product-guides/skills) for full details.

### Interacting via the desktop

The Android emulator runs as a window on Devin's Linux desktop. This means:

* **Devin can interact with it via Computer Use** — tapping buttons, swiping, typing text, navigating between screens
* **You can watch live** via the **Desktop** tab in the Devin webapp
* **Recordings capture the emulator screen** alongside anything else visible on Devin's desktop

For details on how desktop interaction works, see [Computer Use](/work-with-devin/computer-use).

### Using `adb`

Devin can also interact with the emulator programmatically via `adb`, which is useful for:

* **Installing APKs** — `adb install app-debug.apk`
* **Running instrumented tests** — `adb shell am instrument -w com.example.test/androidx.test.runner.AndroidJUnitRunner`
* **Capturing logs** — `adb logcat` to debug crashes or unexpected behavior
* **Taking screenshots** — `adb exec-out screencap -p > screenshot.png`
* **Simulating user input** — `adb shell input tap 500 800` for scripted interactions

Devin chooses between `adb` and Computer Use depending on the task — `adb` for speed and automation, Computer Use for visual verification and complex UI flows.

## Blueprint Examples

Copy-paste blueprints for common Android setups. Each template is self-contained — paste it into your blueprint editor and save.

<AccordionGroup>
  <Accordion title="Native Android (Kotlin/Java + Gradle)">
    ```yaml theme={null}
    initialize:
      - name: "Install Android SDK"
        run: |
          export ANDROID_HOME="$HOME/android-sdk"
          mkdir -p "$ANDROID_HOME/cmdline-tools"
          cd "$ANDROID_HOME/cmdline-tools"
          curl -fsSL https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o tools.zip
          unzip -q tools.zip -d latest-tmp
          mv latest-tmp/cmdline-tools "$ANDROID_HOME/cmdline-tools/latest"
          rm -rf tools.zip latest-tmp
          echo "export ANDROID_HOME=$ANDROID_HOME" >> ~/.bashrc
          echo 'export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH' >> ~/.bashrc
          export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH"
          yes | sdkmanager --licenses > /dev/null 2>&1
          sdkmanager "platform-tools" "build-tools;34.0.0" "platforms;android-34" "emulator" "system-images;android-34;google_apis;x86_64"
          echo "no" | avdmanager create avd -n devin -k "system-images;android-34;google_apis;x86_64" --device "pixel_6"

    maintenance: |
      ./gradlew assembleDebug

    knowledge:
      - name: build
        contents: ./gradlew assembleDebug
      - name: test
        contents: ./gradlew test
      - name: lint
        contents: ./gradlew lint
      - name: emulator
        contents: |
          Start the emulator: emulator -avd devin -no-window -no-audio -gpu swiftshader_indirect &
          Wait for boot: adb wait-for-device && adb shell getprop sys.boot_completed
          Install APK: adb install app/build/outputs/apk/debug/app-debug.apk
    ```
  </Accordion>

  <Accordion title="React Native">
    ```yaml theme={null}
    initialize:
      - name: "Install Node.js"
        run: |
          nvm install 20
          nvm use 20

      - name: "Install Android SDK"
        run: |
          export ANDROID_HOME="$HOME/android-sdk"
          mkdir -p "$ANDROID_HOME/cmdline-tools"
          cd "$ANDROID_HOME/cmdline-tools"
          curl -fsSL https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o tools.zip
          unzip -q tools.zip -d latest-tmp
          mv latest-tmp/cmdline-tools "$ANDROID_HOME/cmdline-tools/latest"
          rm -rf tools.zip latest-tmp
          echo "export ANDROID_HOME=$ANDROID_HOME" >> ~/.bashrc
          echo 'export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH' >> ~/.bashrc
          export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH"
          yes | sdkmanager --licenses > /dev/null 2>&1
          sdkmanager "platform-tools" "build-tools;34.0.0" "platforms;android-34" "emulator" "system-images;android-34;google_apis;x86_64"
          echo "no" | avdmanager create avd -n devin -k "system-images;android-34;google_apis;x86_64" --device "pixel_6"

    maintenance: |
      npm install
      cd android && ./gradlew assembleDebug

    knowledge:
      - name: build
        contents: cd android && ./gradlew assembleDebug
      - name: test
        contents: npm test
      - name: lint
        contents: npm run lint
      - name: emulator
        contents: |
          Start the emulator: emulator -avd devin -no-window -no-audio -gpu swiftshader_indirect &
          Wait for boot: adb wait-for-device && adb shell getprop sys.boot_completed
          Run on device: npx react-native run-android
    ```
  </Accordion>

  <Accordion title="Flutter">
    ```yaml theme={null}
    initialize:
      - name: "Install Flutter"
        run: |
          cd "$HOME"
          git clone https://github.com/flutter/flutter.git -b stable --depth 1
          echo 'export PATH=$HOME/flutter/bin:$PATH' >> ~/.bashrc
          export PATH="$HOME/flutter/bin:$PATH"
          flutter precache --android
          yes | flutter doctor --android-licenses > /dev/null 2>&1

      - name: "Install Android SDK"
        run: |
          export ANDROID_HOME="$HOME/android-sdk"
          mkdir -p "$ANDROID_HOME/cmdline-tools"
          cd "$ANDROID_HOME/cmdline-tools"
          curl -fsSL https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o tools.zip
          unzip -q tools.zip -d latest-tmp
          mv latest-tmp/cmdline-tools "$ANDROID_HOME/cmdline-tools/latest"
          rm -rf tools.zip latest-tmp
          echo "export ANDROID_HOME=$ANDROID_HOME" >> ~/.bashrc
          echo 'export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH' >> ~/.bashrc
          export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH"
          yes | sdkmanager --licenses > /dev/null 2>&1
          sdkmanager "platform-tools" "build-tools;34.0.0" "platforms;android-34" "emulator" "system-images;android-34;google_apis;x86_64"
          echo "no" | avdmanager create avd -n devin -k "system-images;android-34;google_apis;x86_64" --device "pixel_6"

    maintenance: |
      flutter pub get

    knowledge:
      - name: build
        contents: flutter build apk --debug
      - name: test
        contents: flutter test
      - name: lint
        contents: flutter analyze
      - name: emulator
        contents: |
          Start the emulator: emulator -avd devin -no-window -no-audio -gpu swiftshader_indirect &
          Wait for boot: adb wait-for-device && adb shell getprop sys.boot_completed
          Run on device: flutter run -d emulator-5554
    ```
  </Accordion>

  <Accordion title="Kotlin Multiplatform">
    ```yaml theme={null}
    initialize:
      - name: "Install Android SDK"
        run: |
          export ANDROID_HOME="$HOME/android-sdk"
          mkdir -p "$ANDROID_HOME/cmdline-tools"
          cd "$ANDROID_HOME/cmdline-tools"
          curl -fsSL https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o tools.zip
          unzip -q tools.zip -d latest-tmp
          mv latest-tmp/cmdline-tools "$ANDROID_HOME/cmdline-tools/latest"
          rm -rf tools.zip latest-tmp
          echo "export ANDROID_HOME=$ANDROID_HOME" >> ~/.bashrc
          echo 'export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH' >> ~/.bashrc
          export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH"
          yes | sdkmanager --licenses > /dev/null 2>&1
          sdkmanager "platform-tools" "build-tools;34.0.0" "platforms;android-34" "emulator" "system-images;android-34;google_apis;x86_64"
          echo "no" | avdmanager create avd -n devin -k "system-images;android-34;google_apis;x86_64" --device "pixel_6"

    maintenance: |
      ./gradlew :androidApp:assembleDebug

    knowledge:
      - name: build
        contents: ./gradlew :androidApp:assembleDebug
      - name: test
        contents: ./gradlew allTests
      - name: lint
        contents: ./gradlew detekt
      - name: emulator
        contents: |
          Start the emulator: emulator -avd devin -no-window -no-audio -gpu swiftshader_indirect &
          Wait for boot: adb wait-for-device && adb shell getprop sys.boot_completed
          Install APK: adb install androidApp/build/outputs/apk/debug/androidApp-debug.apk
    ```
  </Accordion>
</AccordionGroup>

## Troubleshooting

### Emulator won't start

**Common causes:** KVM not available in the VM, insufficient memory, or a missing system image.

**Fix:** Devin can attempt to configure KVM automatically when it detects the emulator needs hardware acceleration — in most cases, this resolves the issue without manual intervention. If KVM still isn't available after Devin's attempt, the emulator can fall back to software rendering mode — add `-no-accel` to the emulator launch command, though performance will be reduced. Also check that your blueprint installs the emulator and a compatible `x86_64` system image.

### Build fails with SDK errors

**Common causes:** Missing SDK components, incorrect `ANDROID_HOME` path, or Gradle can't find the right build tools version.

**Fix:** Verify that `ANDROID_HOME` is set correctly in your blueprint and that `sdkmanager` installs the platform version and build tools version your project requires. Check your project's `build.gradle` for `compileSdk`, `targetSdk`, and `buildToolsVersion` and match them in the blueprint.

### Emulator is slow

The Android emulator runs inside Devin's VM, so performance depends on the system image and rendering mode.

**Tips:**

* Use `x86_64` system images (not ARM) for hardware-accelerated emulation
* Use `-gpu swiftshader_indirect` for software rendering that doesn't require GPU passthrough
* Use `-no-window -no-audio` when Devin doesn't need the visual display (e.g., running instrumented tests via `adb`)
* Consider a lower-resolution device profile if visual fidelity isn't critical

### Devin can't interact with the emulator screen

**Common causes:** Desktop mode is not enabled, the emulator window is not visible, or the emulator is running in headless mode.

**Fix:** Ensure [Desktop mode](/work-with-devin/computer-use#how-to-enable-it) is enabled in your organization's settings. If you need Devin to visually interact with the emulator, launch it *without* the `-no-window` flag so the emulator GUI appears on Devin's desktop. Check that the emulator has fully booted (`adb shell getprop sys.boot_completed` should return `1`) before asking Devin to interact with it.
