I am using SharedPerefences plugin in Flutter in a macOS application, how can I clear shared preferences? Where are shared preferences stored on disk? Default macos UserDefaults are stored in Library/Preferences, but seems Flutter saves somewhere else.
Clear Flutter sharedpreferences on macos
Asked Answered
Do you want to specifically clear it manually? –
Aggressive
Yes, sometimes I need to do it manually. –
Dianadiandra
Please share an answer if you found a solution, Im struggling with this too –
Sauter
How can we clear it programmaticaly –
Calque
In Flutter, the SharedPreferences data is stored on the device in which the app is running. When you debug an app on macOS using an emulator, the SharedPreferences data is saved in the emulator's virtual file system.
Specifically, on macOS, the SharedPreferences data is saved in the following location:
~/Library/Containers/<App Bundle Identifier>/Data/Library/Preferences/
where is the unique identifier for your app, as specified in your app's Info.plist file.
On macos sharedprefs file is stored in a different place depending on the context :
- debug file is in: Library/Preferences/com.yourName.yourApp
- release file is in: ~/Library/Containers/com.yourName.yourApp/Data/Library/Preferences/
© 2022 - 2024 — McMap. All rights reserved.