昨天在使用adb卸載程序,結果死活卸載不了。我輸入的命令和系統提示如下:
- D:\testApk>adb uninstall HelloWorld
- Failure
后來發現原來卸載程序時,只adb uninstall 后邊的參數不應該是.apk文件,而是包名,即AndroidMainifest.xml文件中<manifest>節點下,package元素所指定的名字,如下所示
- D:\testApk>adb uninstall org.crazyit.helloword
- Success
安裝apk的方式:
1. adb install -r Android-gateway-nightly.apk
如果安裝apk到rom中,提示 “exsit 。。。” 的提示信息,可以加上 - r 參數 ,可以替換原有的apk
2. adb shell pm clean com.cvte.health
可以清除 某個包apk的數據,就是相當於清除數據
附加:
adb install [-l] [-r] [-s] <file> -
EN
push this package file to the device and install it -
CHS
給設備安裝軟件
('-l' means forward-lock the app) #鎖定該程序
('-r' means reinstall the app, keeping its data) #重新安裝該程序,保存數據
('-s' means install on SD card instead of internal storage) #安裝在SD卡內,而不是設備內部存儲
adb uninstall [-k] <package> -
EN
remove this app package from the device -
CHS
從設備刪除程序包
('-k' means keep the data and cache directories) #不刪除程序運行所產生的數據和緩存目錄(如軟件的數據庫文件)
