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