Uninstall app without deleting data I am building an app that receives updates from a server. So at the beginning of the app, a download occurs. However, this thing is getting a bit annoying since whenever I want to test a new build, I would use:

adb -d uninstall com.mycompany.myapp


This command removes the app as well as its data/cache stored. Now, whenever I do this, I would have to go through the process of downloading the updates again and it takes time (a lot of it).

Is there an adb command that would uninstall the app without removing its data/cache? Eclipse ADT can do this but I don't want to fire up Eclipse everytime I build.

EDIT: I've tried using adb uninstall -k com.mycompany.myapp but it always responds with this:

The -k option uninstalls the application while retaining the data/cache.
At the moment, there is no way to remove the remaining data.
You will have to reinstall the application with the same signature, and fully uninstall it.
If you truly wish to continue, execute 'adb shell pm uninstall -k com.mycompany.myapp'


If I try adb shell pm uninstall -k com.mycompany.myapp it just says Failed.
If you run adb with no arguments, the help text will tell you the answer to this question.

adb uninstall -k com.mycompany.myapp


removes the app but leaves the data and cache directories. Similarly,

adb install -r myapp.apk


reinstalls an existing app with a new APK file, keeping its data intact.

As a side-note, I don't know if this affects you, but don't forget that Google Play's developer terms forbids apps from updating themselves (updating the APK file) through a non-Google-Play channel. This is to stop developers side-stepping the Google Play terms by building a 'stub' app that, once installed, replaces itself with an app that doesn't meet the Google Play terms. Updating data files and the like is perfectly fine.