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

# mobster serve

> Start the local API that Mobster for Mac and other clients use.

Start the loopback HTTP API (127.0.0.1 only) that Mobster for Mac launches as its sidecar. Every request needs the launch's API token. Scripting with it: [https://docs.mobster.dev/scripting](https://docs.mobster.dev/scripting.md)

## Usage

```text theme={"theme":"css-variables"}
mobster serve [options]
```

## Options

| Name | Default | Description |
| - | - | - |
| `--port PORT` | 8765; 0 picks a free one | port on 127.0.0.1 |
| `--wda-url URL` | none, or [http://127.0.0.1:8100](http://127.0.0.1:8100) with `--manage-device` | the WebDriverAgent to drive; a simulator's runner listens on its own port |
| `--device NAME` | the only device, else the one last used | the device a task that names none runs on: an id, UDID or name from `mobster devices` |
| `--manage-device` | off | own the USB iPhone setup: build, run and supervise the helper app (the Mac app does this) |
| `--data-dir PATH` | none | where the managed device keeps its files |
| `--exit-with-parent` | off | shut down when the launching process exits (the Mac app's safety net) |
| `--keep-runner` | off | leave the iPhone runner running on exit, for development reloads; the next server adopts it |
| `--env-file PATH` | none | load KEY=VALUE lines (ANTHROPIC\_API\_KEY, OPENAI\_API\_KEY, ...); variables already set win |
| `--session ID` | none | preferred WDA session; the one WDA is serving always wins |
| `--enable-live` | off | allow tasks to act on the phone |
| `--spend-cap-usd USD` | none | stop a run before further model calls once its observed inference spend reaches USD |
| `--state-db PATH` | .state/ beside the source in a checkout, else \<data dir>/state/ | the private task journal (never automatically replays interrupted tasks) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.