Is it possible to preserve file-persisted data when upgrading an app? For example my app stores data under /data/data/mypkg/store. I would like the store directory to be preserved when user upgrades my app.
Application data is not deleted when upgrading apps. It is only removed when they are uninstalled
Please refer to adb documents.
adb install [-l] [-r] [-s] - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
adb uninstall [-k] - remove this app package from the device
('-k' means keep the data and cache directories)
Add '-r' when you reinstall.
Add '-k' when you uninstall.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With