Skip to main content

mobilebox (Python)

Python client for Mobilebox: cloud Android phones your agent drives over REST. Create a phone, read the screen as numbered elements, tap and type, install apps, delete the phone. Standard library only, Python 3.10+, typed.

pip install mobilebox
export MOBILESANDBOX_API_KEY=...   # from https://mobilebox.dev/dashboard; never in a prompt or a commit
from mobilebox import Mobilebox

mb = Mobilebox()
phone = mb.create_phone(name="settings-check", idle_timeout=120, max_duration=300)
try:
    result = mb.act(phone.id, [
        {"type": "open_app", "package": "com.android.settings"},
        {"type": "scroll_to", "text": "Display"},
        {"type": "tap", "target": {"text": "Display"}},
        {"type": "wait_for", "text": "Brightness level"},
    ])
    if not result.ok:
        raise result.error            # has .code and .next: what to do instead
    print(result.screen.find("Brightness level").summary)
finally:
    mb.delete_phone(phone.id)         # always clean up; park_phone() keeps apps and logins

create_phone returns once the phone is ready (about 18 s). A new account has $2 of credit; a cloud phone costs $0.01 per minute while ready, parked phones are free.

Methods

Method Does REST
create_phone(idempotency_key=None, wait=True, **options) Create a phone; with wait, return it ready. Options: name, platform, device, country, city, network, idle_timeout, max_duration, timezone, locale, location, proxy, task POST /v1/phones
list_phones(), get_phone(id) Phones in this workspace, one phone GET /v1/phones[/{id}]
park_phone(id), start_phone(id) Shut down and stop billing; resume with apps and data POST /v1/phones/{id}/park, /start
delete_phone(id) Delete the phone and everything on it DELETE /v1/phones/{id}
observe(id) The screen: Screen(text, app, elements) GET /v1/phones/{id}/observe
act(id, actions) Run 1–20 actions, stop at the first failure: ActResult(results, screen) POST /v1/phones/{id}/actions
screenshot(id) PNG bytes GET /v1/phones/{id}/screenshot
install_app(id, url=… | file=…, grant_permissions=False) Install an APK, .apks or .xapk from a public URL, a path or bytes POST /v1/phones/{id}/apps
watch(id) A read-only live view link for a person POST /v1/phones/{id}/view
request(method, path, body) Any other endpoint, with the same auth and errors

Actions and targets: {"type": "tap", "target": {"text": "Sign in"}}, {"type": "type", "text": "hello"}, scroll_to, wait_for, back, home, open_app and more in the API reference.

Errors

Every failure raises MobileboxError with code, message, next (what to do instead), retryable, retry_after and the HTTP status. Do what next says before retrying.

  • A failed action is not an exception. act returns result.ok == False and result.error; earlier actions stay applied. Continue from result.screen, don't replay the batch.
  • create_phone sends an Idempotency-Key (a UUID unless you pass one) and retries retryable errors with it, so a lost response never makes a second phone. Pass your own key to retry across processes.
  • phone_limit (429) and box_full (503) are not retried: park or delete the phone next names, or wait retry_after seconds.

Configuration

Default
api_key MOBILESANDBOX_API_KEY
base_url MOBILESANDBOX_URL, else https://mobilebox.dev
timeout 65 s per request (server waits cap at 55 s)
user_agent mobilebox-python/<version>; yours goes in front of it

For agent frameworks: langchain-mobilebox wraps this client as LangChain tools. Any MCP client can use https://mobilebox.dev/mcp directly (setup).

Development

pip install -e . pytest
pytest                                      # offline, against a local stub
MOBILEBOX_LIVE=1 MOBILESANDBOX_API_KEY=... pytest -m live   # one real phone, deleted at the end (about $0.01)

MIT © fifteenA, Inc.

Metadata

Release files for mobilebox 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mobilebox 0.1.0
File Size Uploaded Provenance Actions
mobilebox-0.1.0.tar.gz 10.3 kB With provenance Details for mobilebox-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mobilebox 0.1.0
File Interpreter ABI Platform Actions
mobilebox-0.1.0-py3-none-any.whl Python 3 none any Details for mobilebox-0.1.0-py3-none-any.whl

Total release size: 18.8 kB

Release files / mobilebox-0.1.0.tar.gz

Download URL mobilebox-0.1.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
903dc601de0df49fb5e804787e09e8af300dd7fbf807c5a85018423ab6f4c1b3
BLAKE2b-256 checksum
How to use checksums
cd6393dffa5e66fa2b0cacfbdfc10b74942b111f34828943bdb55ee3272c5390
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / mobilebox-0.1.0-py3-none-any.whl

Download URL mobilebox-0.1.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c48e0221fe1563182178a24aab5213b9faa9141bea98238faa2ad067634ea15d
BLAKE2b-256 checksum
How to use checksums
eab84e0b741b823867a8cea053d06ca3728ad788c0a693a2b093c1e49862110b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for mobilebox 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mobilebox-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page