124

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)

4 Answers 4

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 ?

4
  • 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? Mar 10, 2010 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. Mar 10, 2010 at 16:48
  • 1
    Is there any way to view stack traces when installed this way?
    – Vincent
    Jun 8, 2011 at 8: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, 2014 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
-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

2
  • While that might be the correct answer, it's better to provide an example. read the How to Answer page for more info.
    – ItamarG3
    Jun 27, 2017 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, 2018 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.