Posts | Tags | Archive

Reinstalling an Android app without losing data

When an application isn't opening (and clearing the cache doesn't help) it sometimes helps to reinstall it. However, uninstalling then reinstalling the app normally will delete all the data associated with it.

The way around this is to directly call the package manager from the shell and give it the -k argument, which tells it to keep the data and cache directories.

Simply connect the device to a computer with ADB installed and run:

1
adb -d shell "pm uninstall -k com.package.name"

Then just reinstall the app (either from an apk file or the Play Store) and the app will be back with all of its data intact.

© Carey Metcalfe. Built using Pelican. Theme is subtle by Carey Metcalfe. Based on svbhack by Giulio Fidente.