通过adb安装apk无法删除旧apk

时间:2015-07-17 12:41:32

标签: android

我尝试通过adb安装apk到连接的设备:

adb -d install android-debug.apk

但无法删除旧的apk:

2956 KB/s (2131317 bytes in 0.704s) pkg: /data/local/tmp/android-debug.apk Failure [INSTALL_FAILED_ALREADY_EXISTS] rm failed for -f, No such file or directory

有没有办法强制安装?

1 个答案:

答案 0 :(得分:2)

adb install -r android-debug.apk

-r取代现有的APK。

我知道,它是not documented ...但是命令的--help列出了:

adb install [-lrtsd] <file> - push this package file to the device and install it
                             (-l: forward lock application)
                             (-r: replace existing application)
                             (-t: allow test packages)
                             (-s: install application on sdcard)
                             (-d: allow version code downgrade)
                             (-p: partial application install)