Skip to content

Guides

Demo offline with mock sets

Record an app's API traffic once, then replay it with no network using a Mock Set, so a demo works on a plane or a flaky conference Wi-Fi.

You have a demo on a plane or on conference Wi-Fi you can’t trust. This guide records your app’s API responses once while the network is good, then replays them with no network at all using a Mock Set, so the app behaves exactly as it did when you recorded it. It also shows the headless cloakctl equivalent.

Cloak Proxy capturing the app, with HTTPS decrypted See Debug a mobile app or macOS traffic
A good network for the recording pass You’re capturing the real responses to replay later
  1. With capture and decryption on, run through the exact demo you’ll give: open every screen, scroll the lists, tap into the details. A Mock Set can only replay requests it recorded.

  2. If a screen loads more as you scroll (pagination), scroll it during recording so those pages are captured too.

Right-click the app’s domain in the sidebar and choose Mock host Offline. Every captured response from that host becomes a strict offline set, and the Mock Sets tool opens with it selected.

A Mock Set with Offline on: nothing reaches the real host while it's on.

  1. Tool on/off
  2. Offline: unrecorded requests get a 404
  3. Ignore query strings when matching
  4. Recorded responses
The Mock Sets tool with a set, an Offline checkbox ticked, a query-string option, and a table of recorded responses
  1. Leave Offline: answer unrecorded requests to these hosts with 404 on. This guarantees the demo never touches the network, so a dropped connection can’t break it.

  2. If your demo requests differ slightly from the recording (a timestamp or token in the query), turn on Ignore query strings when matching so /feed?token=… still matches.

  3. Select any response to fix it up before the demo — change a name, a price, a status — the same editor as Map Local.

  1. Turn the set on with the switch at the top of the Mock Sets tool. The status bar shows Mock Sets while it’s active.

  2. Disconnect from the network (or just unplug Wi-Fi to prove it). Use the app: matching requests are answered from the snapshot, tagged Mock in the traffic list.

  3. Any request you didn’t record returns a 404 with a body that says which request wasn’t in the set — a useful hint if a screen looks empty.

To record and replay from the command line, use the CI recorder. This is handy for a scripted demo or an offline test run.

Terminal
# Record real traffic while a command runs
cloakctl run --ssl '*' --record demo.har -- ./run-the-app.sh
# Later, replay it offline — no network needed
cloakctl run --mock demo.har --quiet -- ./run-the-app.sh

--mock loads the HAR as a Mock Set and answers requests from it. See cloakctl and Headless and CI.

  1. After the demo, turn Mock Sets off with the switch so the app talks to the real backend again.

  2. Keep the set for next time, or select it and press the minus button to delete it.

  3. On a device, remove the Wi-Fi proxy and profile when you’re done (see iPhone and iPad).