Open AtomicGeorge opened 1 year ago
I'm seeing this same issue. The above workaround does not work for my use case. clearKeychain
nor clearState
clear the state like they do on Android. The only workaround that I have found is to use xcrun to uninstall and reinstall the app.
@brandenbyers @AtomicGeorge Folks, do you by chance use shared user defaults (in an app group)?
What I've found is that running the idb
command found in clearState
docs (here) does clean the "regular" UserDefaults just fine, but doesn't touch the shared ones.
@brandenbyers @AtomicGeorge Folks, do you by chance use shared user defaults (in an app group)?
What I've found is that running the
idb
command found inclearState
docs (here) does clean the "regular" UserDefaults just fine, but doesn't touch the shared ones.
@Losiowaty The example project just uses standard user defaults, no sharing or anything fancy at all.
Describe the bug Launching an app with
clearState
or callingclearState
directly doesn't reliably clearUserDefaults
in an iOS app.To Reproduce
UserDefaults
in an iOS app.or
-clearState
followed by-launchApp
UserDefaults
still contains the previously written value. Expected behavioruserDefaults
should be cleared and the app should be launched as though it had not been used previouslyEnvironment information (please complete the following information):
Workspace (if applicable) MaestroUserDefaultsTestApp.zip
Additional context A workaround I've found is using
-clearState
before runninglaunchApp
with theclearState
option set totrue
as far as I can tell this should delete everything twice which seems to ensure that the app is fairly reliably launched with a completely clear state.