# Agent PRs that break only on Android: catch them before merge

Why React Native and Expo pull requests from coding agents fail only on Android (platform files, keyboard, back, permissions, the native build), how to build the PR’s APK, and how a cloud phone checks it on the PR.

By [Mustafa Yenler](https://mobilebox.dev/about#mustafa) [LinkedIn](https://www.linkedin.com/in/mustafa-yenler) Updated 17 November 2026

Guides4 min read

In this article

To catch the React Native or Expo pull requests that break only on Android, build the PR’s Android APK in CI and open it on a cloud Android phone before anyone merges. A check that reads the JavaScript can’t see these bugs, and an iOS simulator run never renders them. On Mobilebox a phone costs $0.01 a minute, billed per second, so a check that installs the build, walks the changed screen and posts screenshots on the PR costs a few cents (prices as of November 17, 2026).

## Why agent PRs break only on Android

Coding agents usually test where they run: TypeScript, unit tests, maybe an iOS simulator on a Mac. Android-only failures come from code that no step in that loop executes:

- **Platform files and branches.** React Native picks `Button.android.tsx` over `Button.tsx` on Android, and `Platform.OS === 'android'` branches run only there ([Platform-specific code](https://reactnative.dev/docs/platform-specific-code)). An agent that edits the shared file and never opens the `.android` one ships a stale screen.

- **The keyboard.** `KeyboardAvoidingView` behaves differently per platform, and the right `behavior` value differs ([KeyboardAvoidingView](https://reactnative.dev/docs/keyboardavoidingview)). A form that scrolls fine on iOS can hide its submit button under the Android keyboard.

- **Back.** Android has a system back action that iOS doesn’t; screens that intercept it use `BackHandler` ([BackHandler](https://reactnative.dev/docs/backhandler)). A refactor that drops the listener only shows up when someone presses back.

- **Runtime permissions.** Android asks at runtime, through its own dialog, and a denial changes what the app gets ([Request runtime permissions](https://developer.android.com/training/permissions/requesting)). The flow behind the dialog never runs in a JS-only check.

- **The native build.** A new native module or a Gradle change can fail `assembleRelease` while the JavaScript type-checks clean.

None of these is exotic. They’re just on the platform nobody opened.

## Build the APK the PR actually changed

**Expo (EAS).** An installable APK needs a build profile with `"android": { "buildType": "apk" }` in `eas.json`; the default store build is an AAB ([Build APKs for Android emulators and devices](https://docs.expo.dev/build-reference/apk/)). Then `eas build --platform android --profile preview` on the PR.

**Bare React Native.** In `android/`, run `./gradlew assembleRelease`. A debug build loads its JavaScript from the Metro dev server, so it won’t start on its own on a remote phone. The release build bundles the JavaScript, and the default template signs it with the debug key.

Mobilebox phones are Android 14 on arm64, so the APK needs the `arm64-v8a` ABI, which React Native builds by default. Split bundles install too ([install guide](https://mobilebox.dev/blog/install-apk-split-bundles)).

## Open it on a phone in the PR

Two ways, depending on how much of the flow you want checked:

**Every push: the GitHub Action.** [mobilebox-dev/android-smoke-action](https://github.com/mobilebox-dev/android-smoke-action) installs the APK on a fresh phone, opens it, waits for a text you name and deletes the phone. On a pull request it posts one comment with a screenshot, the time and the cost, and updates it on each push. After checkout and `npm ci`, the two steps for an Expo app:

```
      - run: npx eas-cli build --platform android --profile preview --local --output app.apk --non-interactive
        env:
          EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
      - uses: mobilebox-dev/android-smoke-action@v1
        with:
          apk: app.apk
          wait-for: Welcome
          api-key: ${{ secrets.MOBILESANDBOX_API_KEY }}
```

**The changed flow: your coding agent over MCP.** Add `https://mobilebox.dev/mcp` to Claude Code, Cursor or Codex and sign in ([setup per tool](https://mobilebox.dev/blog/android-mcp-cursor-codex-vscode)). Then give the agent that wrote the PR the check it skipped:

```
Install the APK from this PR on a Mobilebox phone. Open the checkout
screen, focus the card number field and confirm the Pay button is still
visible with the keyboard open. Press back and confirm the cart comes
back. Call publish_proof with before and after screenshots, post the
Markdown on the PR, then delete the phone.
```

The agent reads the screen as numbered elements, taps and types, and handles the permission dialog like any other screen ([agent guide](https://mobilebox.dev/docs/agents)). The proof comment shows the device, the time and the cost, all taken from the phone’s own session. What the comment looks like and what is kept: [Screenshots in every pull request](https://mobilebox.dev/blog/screenshots-in-every-pull-request).

## What this doesn’t cover

A Mobilebox phone is an Android 14 cloud phone without Google Play. Bugs that need a specific vendor’s hardware, Play Integrity or Play services need a real device ([when that matters](https://mobilebox.dev/blog/real-android-devices-vs-cloud-phones)). For layout, keyboard, back, permissions and "does the build even start", a phone per PR is enough, and it runs before a human has to.

[Mustafa Yenler](https://mobilebox.dev/about#mustafa) is the founder of fifteenA and builds Mobilebox, from Berlin and San Francisco. [LinkedIn](https://www.linkedin.com/in/mustafa-yenler)

## Try it in your agent in 60 seconds

Paste this into Claude Code, Cursor, Codex or any agent that can read a web page. It asks for your email, gets its own key at once and adds the phone tools; the 6-digit code from your inbox keeps the workspace.

```
Set up Mobilebox for me: read https://mobilebox.dev/setup.md?via=react-native-android-agent-prs and follow it.
```

[What your agent reads](https://mobilebox.dev/setup.md?via=react-native-android-agent-prs)

In this article

[All articles](https://mobilebox.dev/blog)

## Next question

- [Cloud phone or a local emulator?](https://mobilebox.dev/blog/mobilebox-vs-local-emulator?via=next-emulator)
