# Test your app on a bad network with an AI agent

Make a cloud Android phone slow, lossy or offline with one setting, and let your agent check retries, timeouts and offline screens: presets, custom values, and what we measured on production, from ping times to the Wikipedia app’s searches on 2g and offline.

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

Guides5 min read

In this article

Yes: Mobilebox, which runs cloud Android phones for AI agents at $0.01 a minute, lets your agent make one phone’s connection slow, lossy or offline while it runs, then check how your app copes: retries, timeouts, spinners, offline screens. It is one setting, `network_conditions`, on the `set_device` MCP tool or `PATCH /v1/phones/{id}/device`, and the agent keeps full control of the phone the whole time.

## Why test it on the phone

Most teams fake a bad network on the server: a sleep in a handler, a mock that throws. That tests the code path you thought of. It does not test what the app does when a reply is lost halfway, when DNS fails, or when every request takes two seconds. On the phone, the app’s real HTTP client, its real timeouts and its real retry logic meet the slow network, so you see the screen your user would see.

## Set it

```
curl -sS -X PATCH "https://mobilebox.dev/v1/phones/$ID/device" -H "Authorization: Bearer $MOBILESANDBOX_API_KEY" \
  -H 'content-type: application/json' -d '{"network_conditions":"3g"}'
```

Over MCP the agent calls `set_device` with `{"phone_id": "…", "network_conditions": "3g"}`. Send `null` to go back to normal.

| Preset | Added per round trip | Download | Loss |
| --- | --- | --- | --- |
| offline | none | nothing | 100 %, both ways |
| 2g | 650 ms ±100 | 250 kbit/s | 0 |
| 3g | 300 ms ±50 | 750 kbit/s | 0 |
| slow_4g | 150 ms ±20 | 1.6 Mbit/s | 0 |
| lossy | 100 ms ±50 | no cap | 10 % |

Or send your own values: `{"latency_ms": 2000, "jitter_ms": 200, "loss_percent": 5, "bandwidth_kbps": 500}`. Any field you leave out means none.

## What we measured

We ran this on production on November 22, 2026, from our own workspace, over MCP, and measured from inside the phone: ping to 1.1.1.1 and a 300 KB HTTP download.

| Setting | Round trip | Download | Packets lost | Agent’s observe |
| --- | --- | --- | --- | --- |
| normal | 14.5 ms | 240 Mbit/s | 0 % | 72 ms |
| 3g | 318 ms | 565 kbit/s | 0 % | 20 ms |
| custom 2,000 ms ±200 | 2,009 ms |  | 0 % |  |
| custom 30 % loss | 14 ms |  | 31 % of 100 |  |
| offline |  | none, and DNS fails | 100 % | 19 ms |
| null, and after park | 14.5 ms |  | 0 % |  |

The download comes in under the 750 kbit/s cap because TCP is still ramping up over the extra 300 ms on a short transfer, as it would on a real 3G link. The last column is the point: the slow network applies to the app’s traffic, not to the agent’s control of the phone. Screens, taps and screenshots stay fast even when the phone is offline.

## What an app did

Ping times say little about what your user sees. So on November 23, 2026 we installed the Wikipedia app from [F-Droid](https://f-droid.org/packages/org.wikipedia/) on a production phone, opened its search and timed 33 searches over the API, each a new query: from typing the query to the first matching result on screen. The times include typing and our API’s own round trip, so the normal network is the floor, not zero.

| Setting | Searches | Median | Slowest | What the app showed |
| --- | --- | --- | --- | --- |
| normal | 8 | 1.3 s | 1.4 s | results |
| slow_4g | 4 | 1.4 s | 2.6 s | results |
| 3g | 4 | 1.8 s | 5.6 s | results |
| 2g | 4 | 4.1 s | 10.8 s | 3 results; once "Cannot connect to Wikipedia. Check your network connection, or try again later", timeout, and a Retry button |
| lossy, 10 % loss | 4 | 1.4 s | 2.9 s | results |
| custom 30 % loss | 4 | 1.4 s | 1.5 s | results |
| offline | 5 |  |  | 4 times the same "Cannot connect" message with Retry, 20.5 s after typing when timed; once no message and no results for 30 s |

Three things a test on the phone found that a mocked server wouldn’t:

- **Latency hurts, loss barely did.** Small search requests got through 10 % and 30 % packet loss almost as fast as on the normal network, because the connection resends lost packets. On `3g` the slowest search took 5.6 s, four times the normal one; on `2g` one search in four failed.

- **Offline, the user waits 20 s for the message.** The app keeps trying before it says anything; once it reported its own 10-second connect timeout in the message. That is the screen to check in your own app: does it tell the user sooner?

- **Recovery worked.** After the agent sent `null`, which took 0.33 s, tapping Retry showed results in 0.8 to 1.3 s. In the run that never showed a message, the results arrived on their own once the network was back.

## A test your agent can run

1. Install the build with `install_app` and open it.

2. `set_device` with `"offline"`, then do the action that needs the server, such as "Sync" or "Submit order".

3. `observe`: is there an offline message, or a spinner that never ends? While a condition is set, observe starts with a `Network:` line, so the agent knows why things are slow.

4. `set_device` with `null`, and check that the app recovers by itself, without a duplicate order.

5. Repeat with `"lossy"` or `{"latency_ms": 8000}` to find the timeout that fires first.

## What to know

- It lasts for the phone’s session: parking, deleting or a failed session resets it, so a parked phone always starts on a normal network.

- Apps still see a network connection, as on a Wi-Fi with no internet, so this tests what happens when requests fail, not airplane mode.

- The download cap applies to what the phone receives; uploads are not capped.

- iPhone and iPad simulators answer `not_on_ios`; use an Android phone for these tests.

All fields are in the [API reference](https://mobilebox.dev/docs/reference?via=md#network-conditions).

[Mustafa Yenler](https://mobilebox.dev/about?via=md#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=test-app-bad-network-ai-agent and follow it.
```

[What your agent reads](https://mobilebox.dev/setup.md?via=test-app-bad-network-ai-agent)

In this article

[All articles](https://mobilebox.dev/blog?via=md)

## Next question

- [Can I watch my agent work live?](https://mobilebox.dev/live-view?via=next-live)
