亚洲开发银行 - 如何重新安装一个应用程序,不保留数据? [英] adb - How to reinstall an app, without retaining the data?

查看:137
本文介绍了亚洲开发银行 - 如何重新安装一个应用程序,不保留数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

adb install foo.apk

在使用此命令,如果APK存在,我应该得到的错误*失败[INSTALL_FAILED_ALREADY_EXISTS] *

When using this command, if the apk exists, I should get the error *Failure [INSTALL_FAILED_ALREADY_EXISTS]*

 adb install -r myapp-release.apk

在这种情况下,现有的apk将被替换,通过保留老数据 根据文档,

In this case,the existing apk will be replaced, by retaining old data according to the docs,

- R'是指重新安装应用程序,保持它的数据。

'-r' means reinstall the app, keeping its data

现在我怎么重新安装应用程序,但所有的previous数据应被删除?

Now how do I reinstall the app, but all previous data should be erased?

修改

我知道我们可以做到这一点。

I know we can do this

adb uninstall com.package.foo & adb install foo.apk

我只是想知道是否有在亚行本身就是一个命令或什么的。

I just wanted to know if there is a command or something in adb itself.

推荐答案

在安装之前清理数据是这样的:

adb shell pm clear com.package.foo

然后就可以使用正常安装:

then you can install normally using:

adb install foo.apk

或只是通过你的IDE中运行

or just run through your IDE

这篇关于亚洲开发银行 - 如何重新安装一个应用程序,不保留数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆