> ## 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.

# Set up an iPhone or simulator for testing

> Put the helper app on your iPhone or a simulator with guided setup in Mobster.

Setup in Mobster for Mac, or `mobster setup` in a terminal, walks you through each thing below. The helper app takes about 2 minutes to install the first time.

| You need | How to get it |
| - | - |
| Xcode on this Mac, signed in | Install the full app from the App Store, open it once, and sign in under Xcode › Settings › Accounts. A free Apple Account works |
| An AI account | Setup asks for it. Or run `mobster login` |
| A cable, and trust in this Mac | Plug in with a cable that carries data, then [trust this Mac](#trust-this-mac) |
| Developer Mode | [Turn it on](#turn-on-developer-mode) in Settings on the iPhone |
| The helper app | Setup installs it, signed with your Apple Account |
| The helper app running | Setup starts it. `mobster doctor --fix` starts it again if it stops |
| Permission to tap and type | Setup asks you |

[Requirements](https://docs.mobster.dev/requirements.md) lists the Mac and the Mobster account. To test an app with no phone, [set up a simulator](#simulators).

## Set up your iPhone

> [tab] In Mobster for Mac
>
> Mobster for Mac does this on its first run ([Mobster for Mac](https://docs.mobster.dev/quickstart/mac.md)), and for each device after that on **Add a device** ([Devices and health](https://docs.mobster.dev/phones.md#add-a-device)).
>
> 1. Plug in the iPhone, unlock it and tap **Trust**.
> 2. Mobster installs the helper app on the iPhone, signed with the Apple Account in Xcode.
> 3. On the iPhone, open Settings › Privacy & Security › Developer Mode, turn it on and restart. iOS shows the switch once the install has started.
> 4. Choose **Allow** so Mobster can tap and type.
>
> On Add a device, the screen then names your iPhone and says it is ready. The first run goes on by itself.

> [tab] In a terminal
>
> Plug in the iPhone, unlock it and run:
>
> ```sh theme={"theme":"css-variables"}
> mobster setup
> ```
>
> Setup asks before it installs the helper app, and again before it lets Mobster tap and type. Press `y` for each. When every step is done, it prints:
>
> ```text Output theme={"theme":"css-variables"}
> Set up your iPhone                                       6 of 6 done
>
>   ✓ 1. Get your Mac ready
>   ✓ 2. Connect your AI account
>   ✓ 3. Connect your iPhone
>   ✓ 4. Install the helper app on your iPhone
>   ✓ 5. Start the helper app
>   ✓ 6. Allow Mobster to tap and type
>
> ✓ Work iPhone is ready. Give it a first task: mobster
> ```
>
> | When | Run |
> | - | - |
> | Xcode has more than one Apple Account | `mobster setup`. It asks which one signs the helper app |
> | You sign with a paid developer team | `mobster setup --team ID` |
> | Several iPhones are plugged in | `mobster setup --device "Work iPhone"` |
> | The install failed | Do what it says, then `mobster setup` again |

## Trust this Mac

The first time you plug the iPhone into this Mac, iOS asks whether to trust it.

1. Unlock the iPhone.
2. Tap **Trust**.
3. Enter your passcode. Mobster never enters it.

If you tapped **Don't Trust**, unplug the phone and plug it in again, and iOS asks again.

## Turn on Developer Mode

iOS runs the helper app only with Developer Mode on. It's a switch on the phone, and Mobster never turns it on for you.

1. On the iPhone, open **Settings › Privacy & Security › Developer Mode**.
2. Turn on **Developer Mode** and tap **Restart**.
3. After the restart, unlock the phone and tap **Turn On**.

If Settings has no Developer Mode switch yet, it appears once setup installs the helper app, and Setup in Mobster for Mac asks again then. [Developer Mode disabled](https://docs.mobster.dev/troubleshooting/developer-mode-disabled.md) has the message Xcode prints when it's off.

## Check it with `mobster doctor`

`mobster doctor` checks Xcode, the tools, whether the phone is connected and trusted, whether the helper app is installed, signed and answering, and whether the phone is locked:

```sh theme={"theme":"css-variables"}
mobster doctor
```

```text Output theme={"theme":"css-variables"}
Mobster doctor

  ✓ Python            3.12.13
  ✓ Mobster           0.4.0, frozen app build
  ...
  ✓ Xcode             Xcode 26.4
  ✓ iPhone tools      installed
  ✓ iPhone            iPhone 15 Pro, iOS 26.0.1, trusts this Mac
  ...
  ✓ Screen            unlocked
  ✓ In use            no other Mobster is using it
  ...

Ready for tasks.
```

A `✗` line needs fixing, and a `!` line is a warning. Each has its fix under it, after `→`.

## Fix what doctor finds

`mobster doctor --fix` does the fix each finding carries, checks again, and prints what it did and what it couldn't:

```text Output theme={"theme":"css-variables"}
What --fix did

  ✓ Started the helper app on Work iPhone. It answers.
```

| `--fix` | What it does |
| - | - |
| On its own | Starts the helper app and waits up to 90 seconds for it to answer. Refreshes a helper whose 7-day signature ran out, with the Apple Account it was built with |
| After you say yes | Frees the helper's port: it names the program and its command line, then sends it a stop request, and asks again before it forces one that ignored the request. Stops a Mobster service that accepts connections and never answers |
| By handing over | `mobster login` for a missing AI account, `mobster setup` for an iPhone that isn't set up |
| Never | Enters a passcode, taps on the iPhone, runs `sudo`, downloads a runtime, or stops a program by its name |

The taps on the iPhone are yours: unlock it, plug it in, turn on Developer Mode, trust this Mac or the developer app, turn on UI Automation. `--fix` leaves them under the finding that names them.

While Mobster for Mac or `mobster serve` runs, it manages the helper app itself, so `--fix` leaves the helper to it and says so. It also leaves alone a phone another Mobster is running a task on. Without a terminal, or with `--json`, `--fix` skips every question and lists each in `fixes`, with the finding's `cause`, the `kind` of its fix and what happened (`fixed`, `failed`, `refused`, `declined`, `needs_terminal` or `yours`). [Troubleshooting](https://docs.mobster.dev/troubleshooting.md#iphone) lists each message with its fix.

## Keep the phone ready

* Keep the phone unlocked. Mobster can't read the screen while the phone is locked, and never enters a passcode.
* Turn on a Focus mode before long runs, so a notification doesn't take the foreground in the middle of a task.
* A free Apple Account's signature lasts 7 days. From day 5, Mobster rebuilds the helper app by itself ([Keep the helper app running](https://docs.mobster.dev/devices.md#when-the-helper-stops-answering)), and `mobster doctor` says how many days are left.
* One Mobster process controls a phone at a time. While one holds the phone, Mobster refuses a second `mobster serve`, `mobster run --execute` or terminal UI, and `mobster doctor` shows "In use". In Mobster for Mac and `mobster serve`, a second task for a phone in use waits in line ([Share a phone between tasks](https://docs.mobster.dev/devices.md#sharing-a-phone)).

## Set up a simulator

`mobster sim prepare` creates a simulator Mobster manages, boots it headless, builds WebDriverAgent once and starts it on its own port. Then name it from `mobster devices`:

```sh theme={"theme":"css-variables"}
mobster sim prepare
mobster devices        # its name and id
mobster --device "Mobster · iPhone 17 Pro · iOS 26.4"
mobster doctor --simulator \
  --device "Mobster · iPhone 17 Pro · iOS 26.4"
```

`--simulator` skips the USB, Xcode and helper app checks. For a simulator you run WebDriverAgent on yourself, pass its address with `--wda-url`. [Simulators](https://docs.mobster.dev/simulators.md) has the details.

## Script the setup

`mobster serve --manage-device` owns the USB iPhone. It finds Xcode and your Apple development teams, builds the helper app for the connected phone into the Mobster data folder (`~/Library/Application Support/app.mobster.desktop`), then runs and supervises it with the USB relay. Mobster for Mac runs this same server. If Mobster for Mac is set up and running, skip this section: the helper app already answers at `127.0.0.1:8100`.

Start the server, then read the API token from the file named on its first line:

```sh theme={"theme":"css-variables"}
mobster serve --manage-device \
  --env-file "$MOBSTER_ENV_FILE" \
  > /tmp/mobster-serve.log 2>&1 &
sleep 2
TOKEN_FILE=$(head -1 /tmp/mobster-serve.log |
  jq -r .tokenFile)
setup() {
  curl -s -H "Authorization: Bearer $(cat "$TOKEN_FILE")" \
    -H 'Content-Type: application/json' \
    "http://127.0.0.1:8765/api/setup$1" ${2:+-d "$2"}
}
```

| Step | Run |
| - | - |
| See what is done and what is next | `setup \| jq '.steps[] \| {id, state, detail}'` |
| List your Apple development teams | `setup \| jq '.teams'` |
| Build the helper app for the phone, which takes minutes the first time | `setup /build '{"team": "ABCDE12345"}'` |
| Repeat until it says `"succeeded"` | `setup \| jq '.build.state'` |
| Start the helper app and the USB relay | `setup /start '{}'` |
| Let tasks act on the phone | `setup /live '{"enabled": true}'` |

With several phones connected, choose one first with `setup /phone '{"udid": "<UDID>"}'`. The UDIDs are in `setup | jq .devices`, and a build belongs to the phone it was made for.

With `MOBSTER_QUEUE_PREFLIGHT=1`, setup has a Photos step (the content queue's iPhone checks). Mobster for Mac's session sends it with `setup /photos '{}'`, and you answer iOS's question on the iPhone. The step says `done` once the iPhone allows Photos (Limit Access counts), and never holds back `complete`.

Leave `serve` running while you use Mobster. It keeps the helper alive and restarts it if it stops. Then, in another terminal, run `mobster doctor`, then `mobster`.

## How Mobster reaches the iPhone

Mobster drives an iPhone through [WebDriverAgent](https://github.com/appium/WebDriverAgent), an XCTest runner that Xcode builds and installs on the phone. Setup and `mobster doctor` call it the helper app. It serves the phone's accessibility tree and accepts taps and typing over HTTP. On a USB iPhone, `iproxy` relays that HTTP port to `127.0.0.1:8100` on your Mac.

Mobster for Mac includes its own iPhone connection tools (libimobiledevice and `iproxy`). Any other copy of `mobster` gets them from Homebrew: when they're missing, `mobster setup` prints `brew install libimobiledevice`.

> [!WARNING]
>
> WebDriverAgent has no authentication. Mobster binds it to `127.0.0.1` on the Mac. Keep it that way.

`MOBSTER_CAPTURE_GATE=on` in the environment that runs Mobster starts iPhone helpers with the capture gate that [simulators](https://docs.mobster.dev/simulators.md#webdriveragent) run with. iPhone helpers start without it.

## Without Xcode (paid team)

Set `MOBSTER_EXPERIMENTAL_NO_XCODE=1` in your shell or your settings file to set up an iPhone from a Mac with no Xcode, on a team that pays for the Apple Developer Program. A free Apple Account keeps the Xcode path above, with its 7-day signature.

Mobster signs the helper app on your Mac with `codesign`, using a development certificate and a provisioning profile that your own team makes through Apple's App Store Connect API. It then installs and starts the helper with `pymobiledevice3` (or `go-ios`). `xcodebuild` and `xcrun` never run.

### What you need without Xcode

* An [App Store Connect API key](https://docs.mobster.dev/dev/app-store-connect.md) with the Admin or Developer role, in your Keychain: `mobster asc key add --key-id KEY_ID --issuer-id ISSUER_ID --p8 AuthKey_KEY_ID.p8`.
* `pymobiledevice3` (GPL-3.0-or-later), which you install yourself with `pipx install pymobiledevice3`. Mobster runs it as a separate program and never bundles it. It looks on your `PATH`, in pipx's folder (`PIPX_BIN_DIR`, else `~/.local/bin`), `/opt/homebrew/bin` and `/usr/local/bin`. `go-ios` (MIT) works as the fallback.
* A prebuilt helper app that matches this install of Mobster. Mobster for Mac carries one. From a checkout, `MOBSTER_PREBUILT_RUNNER` names a folder with `WebDriverAgentRunner-Runner.app` and a `patches.txt`.
* An App ID for the helper on your team. Xcode makes a wildcard App ID that covers it the first time it builds for the team. Mobster doesn't register App IDs, so if your team has none, the card says where to add one.

### What Mobster sends to Apple

Setup shows a card before anything is sent, and `mobster signing card` prints the same card. It lists only the requests still needed, each exactly as it will be sent:

1. Register your iPhone: its name and UDID, once per phone and team.
2. Create a development certificate from a request made on this Mac. The private key stays in a dedicated Mobster keychain on this Mac.
3. Create a development profile for the helper's App ID, listing the certificate and every phone. Adding a phone makes a new profile that lists them all.

Nothing else is written to Apple. You approve the card by its digest:

```sh theme={"theme":"css-variables"}
mobster signing card
mobster signing apply --approve 3f9c2a1b7d0e…
```

Each request is recorded on your Mac before it is sent. If Mobster sends one and never sees Apple's answer, it doesn't send it again. `mobster signing status` lists it, and after you look at developer.apple.com, `mobster signing resolve DIGEST --made` or `--not-made` records what you found. [Privacy](https://docs.mobster.dev/privacy.md#what-mobster-writes-to-apple) lists the writes and what each carries.

### What happens next

1. Mobster signs a copy of the prebuilt helper with the profile, then checks the signature, the team, the bundle id and the profile.
2. If the iPhone has no developer disk image mounted, `pymobiledevice3` mounts one, as Xcode does the first time it prepares a phone. It downloads the image from GitHub and asks Apple's signing service to personalize it for your iPhone.
3. Mobster installs the signed helper and starts it, with the same readiness checks as with Xcode.

Developer Mode is still yours to turn on. If Settings › Privacy & Security has no Developer Mode switch, Setup's **Show the switch** makes it appear.

### Sign once, run on every Mac

A Mac with the key exports the signed helper and its profile, and a Mac with neither the key nor Xcode installs it:

```sh theme={"theme":"css-variables"}
mobster signing export helper.tgz
mobster signing import helper.tgz --team ABCDE12345
```

The import opens the file only if it comes from the team you name, its files are intact, its signature verifies, it matches this install of Mobster, and its profile lists this iPhone with more than a day left. Name the team you expect, since any team's signature verifies. The helper runs only on the iPhones its profile lists, until the profile ends.


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