Android:ADB各类错误

文章目录

      • need APK file on command line
      • Failure[INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]
      • Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
      • Failure [INSTALL_FAILED_INVALID_URI]
      • Failure [INSTALL_FAILED_TEST_ONLY]
      • Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.ah.sample without first uninstalling .]

need APK file on command line

Performing Push Install
adb.exe: need APK file on command line

解决方法:
查看安装包是否后缀不正确,如被微信重命名加了.1


Failure[INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]

Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]

解决
因为在在manifest中设置了 android:sharedUserId="android.uid.system" 属性,但没有进行对应的系统签名。进行系统签名,或者去除android:sharedUserId="android.uid.system" 属性.


Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

解决
版本较老,需要提高所安装的版本号,或卸载后再安装(如果是系统软件,需要root后,删除/system/app对应的软件包)。


Failure [INSTALL_FAILED_INVALID_URI]

  1. 使用绝对路径
adb install /mnt/usb/0BA1-1862/b/demo.apk
  1. 还有说法是加上-r
adb install -r   /mnt/usb/0BA1-1862/b/demo.apk
  1. 也有说需要加系统签名,

Failure [INSTALL_FAILED_TEST_ONLY]

解决
debug版本需要加-t以测试模式运行

adb install -t demo.apk

Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.ah.sample without first uninstalling .]

Performing Streamed Install
adb: failed to install test.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.ah.sample without first uninstalling        .]

解决
有同名包名app,需卸载重装。
如果是系统软件,需要root后,删除/system/app对应的软件包

  • 手动卸载后重装,
  • adb uninstall 包名之后再安装

你可能感兴趣的:(Android)