Open tir38 opened 1 year ago
I need to confirm these even work. I've not seen much documentation on them
A good first step might be to list all shared pref files, and then optionally list their content.
adb shell
run-as $PACKAGE
ls -al /data/data/$PACKAGE/shared_prefs
none of these am broadcast
commands work. I can manipulate/list files contents just fine within adb shell
I'm getting a bug today:
ax shared_prefs list com.example.beta.debug
Listing all shared prefs files for com.example.beta.debug:
run-as: couldn't stat /data/user/0/com.example.beta.debug: No such file or directory
ls: /data/data/com.example.beta.debug/shared_prefs: No such file or directory
Likely because device/ emulator wasn't fully booted. I should add a "is fully booted" check first
Add a value to default shared preferences.
adb shell 'am broadcast -a org.example.app.sp.PUT --es key key_name --es value "hello world!"'
Remove a value to default shared preferences.
adb shell 'am broadcast -a org.example.app.sp.REMOVE --es key key_name'
Clear all default shared preferences.
adb shell 'am broadcast -a org.example.app.sp.CLEAR --es key key_name'