Simulate Memory Warning
idb-simulate-memory-warningTrigger a memory warning in an iOS simulator to test low-memory handling paths like didReceiveMemoryWarning and NSCache purging.
Instructions
idb-simulate-memory-warning
Deliver a memory warning to a simulator, to exercise low-memory code paths.
Overview
iOS reclaims memory aggressively, and the paths that respond to it — didReceiveMemoryWarning,
SwiftUI cache eviction, NSCache purging — are among the least exercised in a typical test run.
Bugs there surface as blank views or lost state on a real device under pressure, long after release.
This delivers the warning on demand, so those paths can be tested deliberately.
Parameters
Optional
udid (string): Target identifier - auto-detects if omitted
scenario (string): Test scenario name, recorded in the audit entry
step (number): Step number within the scenario
Returns
Confirmation with an audit entry (timestamp, action, scenario, step) for test-run reconstruction.
Examples
// Check the app survives memory pressure mid-flow
await idbSimulateMemoryWarningTool({ scenario: 'Checkout under pressure', step: 3 });
await accessibilityQualityCheckTool({}); // did the UI survive?Related Tools
idb-crash-list: Check whether the warning actually killed the app
accessibility-quality-check: Cheap check that the UI is still intact afterwards
simctl-stream-logs: Watch for memory-related log output
Notes
The warning is advisory: iOS may or may not terminate the app depending on its footprint.
Follow with idb-crash-list to distinguish "handled it" from "was jettisoned".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| step | No | Step number within the scenario | |
| udid | No | ||
| scenario | No | Test scenario name for the audit entry |