How to Mock API Responses on a Real Device (Force Mobile Edge Cases)
The hardest mobile bugs live in the states you can't easily trigger: the failed payment, the empty inbox, the slow or malformed response. You could wait for the backend to misbehave — or you can mock the response and force the state on demand, on a real device.
Why mock on a real device (not just a simulator)?
Simulators and unit tests miss real-world behavior — real network stacks, real rendering, real timing. Mocking on an actual iOS or Android device lets you force an edge case and see how the real app handles it.
What you can force
- Error states — return a 500, a timeout, or a malformed body and confirm the app degrades gracefully.
- Empty states — return an empty list and check the "nothing here yet" UI.
- Boundary data — huge lists, long strings, missing fields.
- Specific scenarios — the exact response that reproduces a customer's bug.
How to do it with RobotActions
- Sign in at robotactions.com and open a real device.
- Start network capture to see the requests the app makes.
- Add a mock for the request you want to override — set the status, headers, and body.
- Trigger the flow on the device and watch the app render your mocked response.
No backend changes, no feature flags, no waiting for QA data to line up.
Let an AI agent do it
Because the same capability is exposed as an MCP tool, you can also just ask an agent:
"Capture this app's calls, mock the /orders response to return an empty list, and show me how the screen renders."
The agent sets the mock, triggers the flow, and reports back — on a real device.
Try it
Sign in with Google or GitHub and try request/response mocking free →
Ready to test on real devices?
Sign in with Google or GitHub and get real iOS and Android devices in your browser — free to try.