Clear Simulator Keychain
idb-clear-keychainClear a simulator's keychain to reset credentials that survive app uninstall, ensuring a genuinely clean state for onboarding or authentication tests.
Instructions
idb-clear-keychain
Clear a simulator's keychain, for test isolation.
Overview
Keychain entries survive app uninstall — that is the point of the keychain, and it is why a "fresh install" test can still start logged in. Clearing it gives a genuinely clean credential state before an onboarding or authentication test.
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).
Examples
// Genuinely clean login state — uninstalling the app alone would not do this
await idbClearKeychainTool({ scenario: 'First-run onboarding' });
await workflowFreshInstallTool({ projectPath: './MyApp.xcodeproj', scheme: 'MyApp' });Related Tools
workflow-fresh-install: Wipes app data, but NOT the keychain
simctl-erase: Factory-resets the whole simulator (heavier; also clears the keychain)
simctl-privacy: Reset permission grants, the other thing that survives reinstall
Notes
Destructive: clears credentials for EVERY app on the simulator, not just yours.
Cheaper and more targeted than simctl-erase when credentials are all you need reset.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| step | No | Step number within the scenario | |
| udid | No | ||
| scenario | No | Test scenario name for the audit entry |