-1

In Android, it is possible to view or modify the shared preference using Android Studio. How can I view the shared preferences file using Android Studio?

How can the same be achieved with MacOS apps when I used the SharedPreference Library?

Where is the date even stored in the computer ?

Edit:

I found how to read it:

defaults read uk.co.mytestapp Where can I find the shared_preferences raw json file when running as a MacOS desktop application?

But I still don't know how to write to it.

TSR
  • 17,242
  • 27
  • 93
  • 197

2 Answers2

0

The preferences file is

~/Library/Preferences/uk.co.mytestapp.plist

or if sandboxed

~/Library/Containers/uk.co.mytestapp/Data/Library/Preferences/uk.co.mytestapp.plist

You can open it with the Xcode.

F4D7C
  • 16
  • 3
0

In addition to the accepted answer, I found we could use

defaults write com.example.app flutter.keyname -string "$(cat ./temp2.txt)"

and to read:

defaults read com.example.app flutter.keyname

where keyname is the preference key

TSR
  • 17,242
  • 27
  • 93
  • 197