# Saved states and your local backend

Start a test from the right place: a phone that is already signed in, and an app that talks to the server on your machine.

## Save a phone

MCP calls

```
phone  { "action": "save", "state": "signed-in" }
phone  { "action": "start", "state": "signed-in" }
```

A save keeps the phone's apps, their data, its keychain and its permissions under a name, encrypted under a key of its own. A start with that state, or `restore`on a running phone, puts them back on a phone of the same model and iOS, on any host. The phone restarts, which takes about a minute.

- `states` lists the saved ones, and `delete_state` deletes one.
- States belong to the phones with the same label, so one of a platform's users never lists or restores another's.
- They are kept until deleted, or 90 days after the account's last phone.

## Reach your local backend

Terminal

```
simulator-use cloud tunnel 8080
```

Until you press Ctrl-C, the phone reaches `localhost:8080` on your machine. The answer gives the address the phone's apps use, such as `http://127.0.0.1:20199`: point the app there with its `env`, for example `API_URL=http://127.0.0.1:20199`. Each request is printed with its status and time.

It needs Node 22 or later, lasts while the phone runs, and reconnects by itself after a dropped connection.

While the tunnel is open, anything on the phone reaches that port: its apps, pages in its Safari and your project's build. Nothing outside the phone does.
