adb - How to reinstall an app, without retaining the data?

Solution 1:

Before the installation clean the data like this:

adb shell pm clear com.package.foo

then you can install normally using:

adb install foo.apk

or just run through your IDE

Solution 2:

Try adb uninstall yourpackage.whatever.com, then install again. Or select Clear data on the phone for that application.

Solution 3:

It's adb uninstall com.package.foo && adb install foo.apk, however the uninstall won't work if the app is a system app, which can't be uninstalled. There's the command adb shell pm clear packageName to clear a certain app's data, however it may require root. To reinstall the apk as usual adb install -r app.apk