How to test what will happen when you publish an update to your app to the Market

charlest picture charlest · Feb 14, 2011 · Viewed 7.3k times · Source

I'm about to publish a new version of an app to the Market. In order to avoid any potential problems once its been pushed to the Market and people get notified of an update, I'd like to simulate that process on my phone using the .apk for the new version of the app I'll be publishing.

For instance, it has an update to the SQLite DB it's using.

The closest I can find is using the Android Debug Bridge (adb) using the command: adb install C:\myApplication.apk with my phone attached to my PC via the usb cable. (the parameter represents wherever your apk file is on your PC).

When I do this, if the app is already installed on my phone, I get an error message:

Failure INSTALL FAILED ALREADY EXISTS.

If I delete the existing app from my phone, the adb install command works fine. So, it looks like this can only be used to install an app that doesn't currently exist on your phone.

Is there any way to simulate the update process? It'd be nice if there was an adb update command, but I don't see that.

Answer

Heiko Rupp picture Heiko Rupp · Feb 14, 2011

Try using option -r to adb install:

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)