Android adb 更新非市场 apk?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2414786/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 05:46:51  来源:igfitidea点击:

adb update a non-market apk?

androidadb

提问by lostInTransit

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)

有没有办法可以在 Android 设备上更新(而不是重新安装)非市场 apk?我只能找到 adb 安装(不像 adb 更新)

回答by Vidar Vestnes

adb install -ris 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 ?

adb install -r是您得到的最接近的,这实际上是一个更新,因为它保留了数据库和存储的首选项。如果您卸载/重新安装应用程序数据库和首选项都会被删除。你到底想更新什么 -r 选项对你没有帮助的应用程序?

回答by Waleed Abdalmajeed

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

adb install -r对我不起作用。所以,我做了一些解决方法。

  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.

  1. 卸载应用程序,但使用adb uninstall -k com.packagename. 这将卸载应用程序但保留数据。看到这个

  2. 使用 再次安装应用程序adb install package.here

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

注意:您必须具有 root 访问权限才能执行此命令。

回答by Thierry

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

要重新安装降级版本的应用程序,请使用以下命令:

abd install -d -r package.apk

回答by elazarik

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

与市场 apk 完全相同的最简单方法是将 APK 下载到您的手机(即从 Google Drive 或电子邮件下载),然后单击下载库中的 APK