123

Is there a way we can update (not reinstall) a non-market apk on an Android device? I could only find an adb install (nothing like adb update)

Janusz
  • 187,060
  • 113
  • 301
  • 369
lostInTransit
  • 70,519
  • 61
  • 198
  • 274

4 Answers4

285

adb install -r is the closest you get, that is actually an update as it keeps the database and stored preferences. If you uninstall/re-install both the app database and preferences is deleted. What exactly are you trying to update about the app that -r option does not help you with ?

Vidar Vestnes
  • 42,644
  • 28
  • 86
  • 100
  • There is some data I store in the app which I would like to retain across updates/reinstalls. I figure if this is a limitation, the only way I have is to store it in the SD Card, but thats again a risk if the user deletes the data from the card? – lostInTransit Mar 10 '10 at 15:10
  • 4
    The data you store in the app (in context preferences) will remain there on a reinstall, that is if you use adb -r option.... These data will only be deleted if you uninstall or delete them manually by code. – Vidar Vestnes Mar 10 '10 at 16:48
  • 1
    Is there any way to view stack traces when installed this way? – Vincent Jun 08 '11 at 08:48
  • 4
    Keep in mind that you will need to use an APK signed by the same keystore that signed the currently installed version. – theblang Feb 13 '14 at 16:20
1

adb install -r didn't work for me. So, I did a little workaround.

  1. Uninstall app but keep the data by using adb uninstall -k com.packagename. This will uninstall the app but keeps the data. See this

  2. Install the app again using adb install package.here.

Note: You must have root access to execute this commands.

1

To reinstall a downgraded version of app, use this command:

adb install -r -d package.apk
Moya.A
  • 25
  • 7
Thierry
  • 41
  • 3
-1

The easiest way to do it exactly like market apk, is to download the APK to your phone (i.e. download from Google Drive or from email) and then click on the APK in the Downloads library

elazarik
  • 11
  • 3
  • While that might be the correct answer, it's better to provide an example. read the [answer] page for more info. – ItamarG3 Jun 27 '17 at 13:28
  • 1
    This solution will not work for kiosk or COSU devices or for any device that doesn't allow the user to install apps. – Alex Meuer Jan 16 '18 at 10:25