Skip to main content
After you set up an iPhone with a cable once, Mobster reaches it over Wi-Fi when it’s unplugged. Tasks, the live view, manual control, approvals and --device work the same as on the cable. Wi-Fi for iPhones is off until you turn it on. While it’s off, every task uses the cable.

Turn on Wi-Fi for an iPhone

  1. Set MOBSTER_WIFI_TRANSPORT=1 in your env file, then quit and reopen Mobster. The env file of Mobster for Mac is ~/Library/Application Support/app.mobster.desktop/agent.env. POST /api/wireless with {"wifiTransport": true} does the same while it runs, and MOBSTER_WIFI_TRANSPORT=0 turns it off again.
  2. Plug the iPhone in, unlock it, and turn on Wi-Fi for it:
    This sets the same switch as Xcode’s Connect via network, over the cable, once. When Mobster can’t set it, it tells you to tick Connect via network for the phone in Xcode › Window › Devices and Simulators.
  3. Unplug it, keep it unlocked and on the same Wi-Fi as this Mac, and check the link:
In Mobster for Mac, the same switch is Use over Wi-Fi: on Add a device once the device is ready (“Use Work iPhone over Wi-Fi”, Turn on), and in each device’s Rules… on the Devices page. Add a device’s Over Wi-Fi tile (next release) runs the probe with Check Wi-Fi on an unplugged phone, which takes up to 3 minutes, and shows Works here with the Use devices over Wi-Fi switch once it passes.

Turn it off

mobster wifi off stops using the phone over Wi-Fi at once. When Mobster turned the phone’s switch on, it turns it off on the phone too, over the cable:
When the phone isn’t plugged in, doesn’t trust this Mac or doesn’t let Mobster turn its switch off, the phone still accepts Wi-Fi connections from Macs it trusts. mobster wifi off then says so and exits 1:
Mobster notes the switch before it turns it on, and keeps the note until the switch is off again. So a mobster wifi on or mobster setup that stopped midway still shows, and mobster wifi off with the phone plugged in turns it off. When you ticked Connect via network in Xcode yourself, Mobster leaves that switch alone, tells you to untick it there, and exits 0. With --json, the first case is {"ok": false, "code": "still_on", ...} (or off_failed), and the Xcode case is {"ok": true, "next": {"code": "xcode_on", ...}}.

Set up a new iPhone over Wi-Fi

With Wi-Fi for iPhones on, setting up a new iPhone (the first run, Add a device, or mobster setup) can end wireless, after one cable moment. Mobster asks you first, for each phone:
  • In Mobster for Mac: Use Work iPhone over Wi-Fi with Turn on, on Add a device once the device is ready, and in its card’s Rules….
  • In a terminal: once the phone trusts this Mac, mobster setup asks Use Work iPhone over Wi-Fi when it's unplugged? Mobster turns on its Connect via network switch over this cable, the same switch as in Xcode. Enter means no. After a yes, it waits for the switch to be set before it ends.
  • With no terminal (mobster setup --json, or output to a pipe): Mobster leaves Wi-Fi off, prints {"waiting": "wifi", "hint": ...} and exits 1. The hint names the yes to give: mobster setup on a terminal, or mobster wifi on --device "Work iPhone" with the phone plugged in.
Say yes, and the checklist’s last row is Wi-Fi:
  1. You plug the phone in, tap Trust and say yes. While it’s on the cable, Mobster turns on its Wi-Fi switch once.
  2. You turn on Developer Mode. The phone restarts and drops off the cable for a minute, and Mobster waits up to 5 minutes for it to come back.
  3. The helper app installs over the cable.
  4. Once the helper runs, Mobster waits up to 90 seconds for the encrypted link to the phone. Then the Wi-Fi row says Unplug the phone. If the link doesn’t come up, the phone stays on the cable and the row says why. Close Add a device with Keep working, and Mobster still finishes the step and sends a notification to unplug the phone.
If you say no, the phone says no, or Mobster can’t read its answer, the phone stays on the cable. Turn Wi-Fi on later with mobster wifi on or Use over Wi-Fi. A phone you set up before has no Wi-Fi step. GET /api/setup and GET /api/devices/{device}/setup carry the step as wifi: {state, reason, os, hub, cable}. Its state is asking while Mobster waits for your yes.

Switch between the cable and Wi-Fi

A switch waits until no task is running on the phone. Plug the cable in during a task over Wi-Fi, and the task finishes over Wi-Fi before Mobster moves to the cable. Unplug the cable during a task on the cable, and the task stops. If the link drops during a task you started in Mobster for Mac or the terminal UI, Mobster says “Your iPhone went out of reach over Wi-Fi: bring it back or plug it in and Mobster carries on” and waits 2 minutes. When the phone answers again, over Wi-Fi or the cable, the task goes on. A schedule, mobster run or a coding agent over MCP stops at once with “Your iPhone went out of reach over Wi-Fi, so Mobster stopped.” Either way, Mobster looks at the screen before it sends a step that may or may not have happened, and never sends it again blind. Mobster checks the link every 10 seconds. When it drops, Mobster tries again after 1, 2, 4 and 8 seconds, up to 60, and at once when this Mac joins another network. With two phones, each has its own link and its own ports. In Mobster for Mac, the iPhone’s pane shows a Wi-Fi glyph while it’s on Wi-Fi, and Try again looks for an unreachable phone at once.

When the phone needs you

Over Wi-Fi, iOS asks you to unlock the phone, then for Face ID or its passcode, before it lets the helper app start. When nobody answers, the start fails with “Authentication canceled”. Mobster never unlocks a phone or enters its passcode, so it waits for you:
  • While the phone is locked, the start waits. Unlock the phone, and the start goes on within a few seconds.
  • While iOS asks for Face ID or the passcode, the helper tries again until you answer.
  • The phone reads Needs you on the Devices page and in the device switcher, and its pane says iPhone needs you with the steps: “Unlock it. Use Face ID or its passcode when asked. Or connect it to your Mac with a cable.”
  • Plug the phone in instead, and Mobster uses the cable.
GET /api/wireless gives the problem code needs_you, and in GET /api/devices the phone’s wifi.needsYou is true.

What works over Wi-Fi

An app’s files, audio and logs need the cable. mobster wifi status lists each iPhone set up here: on the cable, on Wi-Fi, or not reachable over Wi-Fi, and whether Wi-Fi is on for it. It reads only. mobster wifi probe checks one unplugged phone step by step and prints what it saw:
  1. Whether this network lets devices see each other.
  2. What Xcode’s device service reports for the phone, with every connection field.
  3. Whether the encrypted link is up, its address is in fd00::/8, and this Mac reaches it through the link (a utun interface that holds this Mac’s end and isn’t a VPN). When it doesn’t, the step says why, for example utun4 holds no address on a link to fd7a:1c2b:3d4e::1 (fd12:3456:789a::2/64), so it isn't the tunnel to the phone.
  4. What devicectl device info lockState and device info apps return. This step doesn’t change the result.
  5. Whether the helper app answers through a relay on 127.0.0.1. With --start, the probe launches the helper over Wi-Fi first and stops it at the end. Quit Mobster for Mac before you use --start.
  6. That 8100 and 9100 don’t answer on the phone’s Wi-Fi addresses or on this Mac’s default gateway. On the phone’s Personal Hotspot, the phone is the gateway, so an answer from the helper there passes.
  7. Whether usbmux lists the phone over the network, for the record only.
It exits 0 when every check passed and 1 when one failed. --json prints one object with each step and its fields.

Networks that keep devices apart

Guest, hotel and campus Wi-Fi often stop devices from reaching each other and block Bonjour, the way Macs and iPhones find each other. On such a network this Mac can’t find the iPhone. Mobster listens for a couple of seconds for what phones, TVs, speakers, printers and computers announce on the network. Hearing nothing on a network that’s up, it says:
This network stops devices from seeing each other. Use the cable or your phone’s hotspot.
mobster doctor, mobster wifi probe, the Wi-Fi tile on Add a device and each device’s Rules all say it. The check only listens through macOS’s own Bonjour service, and sends nothing to the phone. Apple’s CoreDevice tunnel encrypts and authenticates the link between this Mac and the phone. Mobster adds no encryption of its own on it, and checks the route before it uses it:
  • The address is the phone’s own. It must be in fd00::/8, and Xcode’s device service must report the same UDID for it as the phone you set up. Otherwise Mobster starts nothing and says “CoreDevice gave Mobster another iPhone’s Wi-Fi address”, and the phone stays on the cable.
  • The route is the tunnel. The utun interface must hold an address on the same network as the phone’s (a /64 or narrower), or a point-to-point address whose peer is the phone’s. Mobster refuses a default route and a utun that macOS marks as a VPN. It checks before it starts the helper app over Wi-Fi and every 10 seconds while it runs, and stops using Wi-Fi once no task is running when the route stops passing. These checks refuse every route Mobster can tell apart from Apple’s tunnel, and don’t prove that the interface is Apple’s tunnel.
  • The helper app binds to the tunnel. Mobster starts it on the phone’s fd00::/8 address, not its Wi-Fi address. It answers only a request whose Host is 127.0.0.1, localhost or [::1], and refuses one with an Origin header, such as a web page’s. Any program on this Mac can still send those headers.
  • Your network can’t reach it. On this Mac, a relay listens on 127.0.0.1 only, on the phone’s usual ports (8100 and 9100, or 8101 and 9101 for a second phone). After the helper answers, Mobster checks ports 8100 and 9100 at the phone addresses it can resolve, and stops the helper if one accepts. On the default gateway, only an answer from the helper app stops it. The helper stays stopped until you start it again, and error in its state says why.
  • No plain TCP. Mobster never uses usbmux over the network (iproxy -n), which would be plain TCP on your network.
The approval rules are the same as over USB, and Mobster never unlocks the phone.

When it doesn’t work

For a phone with Wi-Fi on, mobster doctor adds whether Xcode’s device service sees it over the network, Developer Mode, whether macOS lets Mobster reach your network, a warning when a VPN is on, and whether this network lets devices see each other. The phone has to be awake for Wi-Fi. For scheduled workflows, keep it unlocked and on the charger.

Control Wi-Fi from a script

Every route needs the API token. With Wi-Fi for iPhones on, each iPhone in GET /api/devices also has transport and wifi (enabled, reachable), and GET /api/events?topics=devices sends transport_changed with device, transport and reachable when a phone moves between the cable and Wi-Fi.