Android的APK安装:如何清除旧版本的文件? [英] Android apk install: How to clear files from old version?

查看:2033
本文介绍了Android的APK安装:如何清除旧版本的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我安装我的apk的新版本,这将覆盖旧版本而不删除它:在新版本中,我删除了一些文件(NDK生成库)---但在设备上,旧的文件仍然存在。

When I install a new version of my .apk, this overwrites the old version without deleting it: In the new version, I deleted some files (libraries generated with NDK) --- but on the device, the old files are still there.

我怎样才能确保无论何时安装新版本,所有旧的文件将被安装之前删除了?

How can I ensure that whenever a new version is installed, all old files will be deleted before the installation?

编辑/澄清:这个问题问了我的应用程序的现有用户的解决方案。我知道我可以通过安装新版本前卸载它清理应用程序自己。但是,其他用户将无法做到这一点---保持在他们的设备上的旧文件。

Edit/Clarification: This question asks for a solution for existing users of my application. I know that I can clean up the application myself by uninstalling it before installing the new version. But other users will not do this --- keeping the old files on their devices.

推荐答案

就在重新安装应用程序

adb install -r myapp-release.apk

您有2个选择:结果
第一种是在安装新版本前卸载应用程序。结果

You have 2 options:
First one is to uninstall your application before installing the new version.

adb uninstall com.your.package

二是在安装新版本之前清除应用程序数据。结果

Second one is to clear application data before installing the new version.

adb shell pm clear com.your.package

这篇关于Android的APK安装:如何清除旧版本的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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