Clear Flutter sharedpreferences on macos
Asked Answered
D

2

6

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.

Dianadiandra answered 24/1, 2022 at 16:23 Comment(4)
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 tooSauter
How can we clear it programmaticalyCalque
D
5

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.

Dissipate answered 8/4, 2023 at 13:3 Comment(0)
E
0

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/
Emend answered 10/11, 2023 at 21:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.