skip to Main Content

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.

2

Answers


  1. Chosen as BEST ANSWER

    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


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search