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.
What you need
Section titled “What you need”| 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 |
Record the demo path
Section titled “Record the demo path”-
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.
-
If a screen loads more as you scroll (pagination), scroll it during recording so those pages are captured too.
Snapshot the responses into a Mock Set
Section titled “Snapshot the responses into a Mock Set”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.
Select the requests in the list and choose Tools → Mock Sets → From Selected Requests. Only those responses are recorded.
A Mock Set with Offline on: nothing reaches the real host while it's on.
- Tool on/off
- Offline: unrecorded requests get a 404
- Ignore query strings when matching
- Recorded responses
-
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.
-
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. -
Select any response to fix it up before the demo — change a name, a price, a status — the same editor as Map Local.
Run the demo offline
Section titled “Run the demo offline”-
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.
-
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.
-
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.
The headless equivalent
Section titled “The headless equivalent”To record and replay from the command line, use the CI recorder. This is handy for a scripted demo or an offline test run.
# Record real traffic while a command runscloakctl run --ssl '*' --record demo.har -- ./run-the-app.sh
# Later, replay it offline — no network neededcloakctl 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.
Clean up
Section titled “Clean up”-
After the demo, turn Mock Sets off with the switch so the app talks to the real backend again.
-
Keep the set for next time, or select it and press the minus button to delete it.
-
On a device, remove the Wi-Fi proxy and profile when you’re done (see iPhone and iPad).