Skip to content

cdp_mmkv

Read/write the app’s MMKV storage from Hermes. Closes the iteration-loop gap where tests had to xcrun simctl uninstall + reinstall to clear cooldowns/timestamps/feature flags. Requires react-native-mmkv v3+ (Nitro-based) — older versions exposed via TurboModule are not reachable. Returns __agent_error if MMKV / NitroModulesProxy is unavailable in the runtime. Actions: get|set|delete|has|keys|clear. Use sparingly: writing to MMKV bypasses the real user flow, so only use during test setup/teardown, not as a substitute for UI interaction (see “Verification Fidelity” rule).

NameTypeRequiredDefaultConstraintsDescription
action`enum: getsetdeletehaskeys
keystringNoRequired for get/set/delete/has actions
valueunknownNoRequired for set action. Combine with type to disambiguate (default: string)
type`enum: stringnumberboolean`No
instanceIdstringNoMMKV instance id (default: “mmkv.default”)
cdp_mmkv(action: <enum: get | set | delete | has | keys | clear>)