How can I view the shared preferences file using Android Studio? Ask Question

How can I view the shared preferences file using Android Studio? Ask Question

I'm using shared preferences to store certain values for my app. I would like to see the file where the info is actually stored on my phone. I found many ways to do this on Eclipse, but I'm debugging on Android Studio. My phone is rooted. I read that having root access is important to read these types of files. If there is no way, then I will look up how to access the info through my program then output it to log cat. Hopefully, though, I can just view the file on the phone directly as it is much simpler. Thanks.

ベストアンサー1

The Device File Explorer that is part of Android Studio 3.x is really good for exploring your preference file(s), cache items or database.

  1. Shared Preferences /data/data//shared_prefs directory

ここに画像の説明を入力してください

It looks something like this

ここに画像の説明を入力してください

To open The Device File Explorer:

Click View > Tool Windows > Device File Explorer or click the Device File Explorer button in the tool window bar.

ここに画像の説明を入力してください

おすすめ記事