NickF
NickF

Reputation: 5737

Edit shared preferences from DDMS

I want to edit shared preferences values from DDMS, if I double click the file it doen't saves the changes. Do I do something wrong or there is special plugin for that?

Upvotes: 9

Views: 8471

Answers (2)

Swathi
Swathi

Reputation: 1684

Just follow the steps, it is easy.

Step 1:enter image description here

Step 2: Open data/data/you package name/shared_prefs -> select your shared pref -> right click and give Save As.

enter image description here

Step 3: Save in your desired folder. I am saving in desktop folder. Dont change the name enter image description here

Step 4: Now edit the needed values in the saved file.

Step 5: Upload the edited file to shared_pref directory enter image description here

Finally close and open the app to make it work. That's all.

Upvotes: 8

A--C
A--C

Reputation: 36449

First, you should probably make sure your app isn't running before doing this.

You have to use the File Explorer option. Navigate to

data -> com.yourpackage -> shared_pref

Click the xml and at the top right click pull.

Edit the xml on your computer.

Once you're done, click push (also top right).

enter image description here

If you pushed the same file to the same device to the same directory, the next time you launch the app, you should see your updated values.

Upvotes: 7

Related Questions