> ## Documentation index
> Fetch the complete index at: https://maritime.sh/llms.txt
> Setup procedure for AI agents (install, sign in, deploy, verify): https://maritime.sh/agents.md
> This page as HTML: https://maritime.sh/docs/phones

# Android phones

Computers on demand

A Maritime Android phone is a virtual Android 15 phone for apps that only exist on mobile. It is a
[computer](https://maritime.sh/docs/computers) with `os: "android"`: the same screenshot, action, file, viewer
and takeover API, plus actions that read the screen as elements and control apps.

## At a glance

| | |
| --- | --- |
| **What it is** | An Android 15 phone (AOSP, 720 x 1280, no Google Play) your agent taps and swipes, with app actions and an adb tunnel. |
| **Use it for** | Mobile apps with no API, and testing with adb, Appium or Maestro. |
| **Use something else when** | A website: [Linux desktop](https://maritime.sh/docs/computers). Windows software: [Windows desktop](https://maritime.sh/docs/windows-desktops). |
| **Start it** | `POST /api/v1/computers` with `"os": "android"`, or New sandbox (`?type=android`), where the deployment has phone hosts. |
| **Lifecycle** | Sleeps after 5 idle minutes with its memory saved and wakes in about a second. Its disk is kept until you delete it. |
| **Price** | $0.15 an hour awake, per second. Asleep: $0.08 per GB-month of disk. |
| **Limits** | x86_64 by default; `"arch": "arm64"` where ARM hosts exist. Apps install as APKs. With no phone host, creating one returns 403 `machine_unavailable`. |
| **Related** | [Linux desktops](https://maritime.sh/docs/computers), [Windows desktops](https://maritime.sh/docs/windows-desktops), [Add-ons](https://maritime.sh/docs/add-ons). |

> Android phones run where Maritime has hosts for them, and New sandbox in the dashboard offers
> an Android phone there. Where a deployment has none, creating one returns 403 `machine_unavailable`.

## When to use it

- Mobile-only apps with no web version and no API.
- Testing an Android app with an agent, or with your own tools over `adb`.

## Create one

From the dashboard, open [New sandbox](https://maritime.sh/dashboard/new-sandbox?type=android)
(`/dashboard/new-sandbox?type=android`), name the phone and click **Create Android phone**.

**REST**

```bash
curl -X POST https://api.maritime.sh/api/v1/computers \
  -H "Authorization: Bearer $MARITIME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"externalUserId": "u_123", "os": "android"}'
```

**CLI**

```bash
maritime computers create --os android
```

**MCP**

```json
{"name": "get_computer", "arguments": {"user_id": "u_123", "os": "android"}}
```

Then open an app and tap. Over REST, Android actions go to the same actions route as every other action:

```bash
curl -X POST https://api.maritime.sh/api/v1/computers/COMPUTER_ID/actions \
  -H "Authorization: Bearer $MARITIME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action": "open_app", "package": "com.android.settings"}'
```

## Actions

- The standard actions map to touch: `left_click` is a tap, `right_click` a long press, `left_click_drag` a
  swipe. Escape is Back, Home is the home screen, Recents is the app switcher.
- Android only: `ui_tree` (the screen as elements with text and centers), `list_apps`, `open_app`,
  `stop_app`, `install_app` (an APK written under `/data`) and `open_url`.
- `exec` runs in the Android shell (`am`, `pm`, `input`). Files under `/data` are the shared storage.
- An `adb` tunnel at `/api/v1/computers/{id}/adb` (WebSocket) lets you attach `adb`, Appium or Maestro.

## Action parameters

Coordinates are pixels on the 720 x 1280 screen, the same frame as the screenshot. The standard actions take
the same fields as on a desktop (full list:
[parameters by action](https://maritime.sh/docs/computers#parameters-by-action)). The ones a phone uses most:

| Action | Parameters |
| --- | --- |
| `left_click` (tap) | `coordinate` `[x, y]` |
| `right_click` (long press) | `coordinate` `[x, y]` |
| `left_click_drag` (swipe) | `start_coordinate` and `coordinate` (the end point) |
| `type` | `text`, typed into the focused field |
| `key` | `text`: `Return`, `Escape` (Back) or `Home` |
| `open_url` | `url` with a scheme, opened in the default browser |
| `open_app`, `stop_app` | `package`, such as `com.android.settings` |
| `install_app` | `path` of an APK under `/data` |
| `ui_tree` | `detail` (optional, adds bounds and ids) |
| `list_apps`, `screenshot` | None |

Open a website in the browser, tap, type and submit, one request each:

```bash
curl -X POST https://api.maritime.sh/api/v1/computers/COMPUTER_ID/actions \
	-H "Authorization: Bearer $MARITIME_API_KEY" \
	-H "Content-Type: application/json" \
	-d '{"action": "open_url", "url": "https://example.com"}'
```

Then the same request with each of these bodies:

```json
{"action": "left_click", "coordinate": [360, 640]}
{"action": "type", "text": "hello"}
{"action": "key", "text": "Return"}
{"action": "left_click_drag", "start_coordinate": [360, 1000], "coordinate": [360, 300]}
```

## What is on the phone

- An AOSP build of Android 15, with a 720 x 1280 screen. Screenshot pixels and tap coordinates match one to one.
- No Google apps and no Google Play. Install apps as APKs.
- The default phone is x86_64 and has no ARM translator, so it does not run apps that ship only ARM code. Where your account has ARM hosts,
  create with `"arch": "arm64"` for those apps; it is slower. Without ARM hosts, that request returns 400 `unsupported_arch`.

## Lifetime and limits

- It sleeps after 5 idle minutes with its memory saved, and wakes on the next action in about a second.
- Its disk is kept until you delete it. Deleting it deletes the disk.
- It is billed at $0.15 an hour while awake and $0.08 per GB-month of disk while asleep, and it counts toward your
  awake-at-once limit while it is awake, like any computer. It runs on the free trial (a card on file) or any plan,
  where phone hosts are available.

Rate limits and errors: [Computers: limits](https://maritime.sh/docs/computers#limits).

## Related

- [Linux desktops](https://maritime.sh/docs/computers)
- [Windows desktops](https://maritime.sh/docs/windows-desktops)
- [Networks](https://maritime.sh/docs/networks)
