1.adb push XXX.apk 目录是将apk发送到手机指定的目录

adb push test.apk /sdcard/test/test.apk

2.adb install 电脑中apk的路径是安装电脑中的apk到手机

adb install /Users/test/test.apk

3.强制安装

有时候会出现Read-only的错误,我们可以使用强制安装命令来安装apk

adb install -r /Users/test/test.apk

adb的安装过程分为传输与安装两步。

在出错后,adb会报告错误信息,但是信息可能只是一个代号,需要自己定位分析出错的原因。

几种常见的错误及解决方法:

1、INSTALL_FAILED_INVALID_APK:无效的安装包,安装包已损坏

请检查安装包是否完整。如果是xpk包,可以通过手动安装xpk来检测一下。如果是apk包,请重   新下载。

2、INSTALL_FAILED_OLDER_SDK:系统版本过低

当前程序不支持您的手机。

3、INSTALL_FAILED_INSUFFICIENT_STORAGE:没有足够的存储空间

4、INSTALL_FAILED_INVALID_INSTALL_LOCATION:无效的安装位置

5、INSTALL_CANCELED_BY_USER:系统禁止安装未知来源的应用

这个要在Android系统设置里修改,勾选安全选项里的未知来源,允许安装。

6、INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES:安装包签名不一致

这样的问题主要是签名冲突造成的,比如你使用了ADB的debug权限签名,但后来使用标准sign签名后再安装同一个文件会出现这样的错误提示,解决的方法除了只有先老老实实从手机上卸载原有版本再进行安装,而adb install -r参数也无法解决这个问题。

7、INSTALL_FAILED_INVALID_URI:

应用为中文名, adb install 中文.apk时出现此问题。修改为英文名就OK了。

错误基本是在 cmd 命令行安装时遇到的。INSTALL_FAILED_ALREADY_EXISTS                 程序已经存在

INSTALL_FAILED_INVALID_APK                     无效的APK

INSTALL_FAILED_INVALID_URI                     无效的链接

INSTALL_FAILED_INSUFFICIENT_STORAGE          没有足够的存储空间

INSTALL_FAILED_DUPLICATE_PACKAGE             已存在同名程序

INSTALL_FAILED_NO_SHARED_USER                要求的共享用户不存在

INSTALL_FAILED_UPDATE_INCOMPATIBLE           版本不能共存

INSTALL_FAILED_SHARED_USER_INCOMPATIBLE     需求的共享用户签名错误

INSTALL_FAILED_MISSING_SHARED_LIBRARY       需求的共享库已丢失

INSTALL_FAILED_REPLACE_COULDNT_DELETE      需求的共享库无效

INSTALL_FAILED_DEXOPT                          dex优化验证失败

INSTALL_FAILED_OLDER_SDK                      系统版本过旧

INSTALL_FAILED_CONFLICTING_PROVIDER          存在同名的内容提供者

INSTALL_FAILED_NEWER_SDK                      系统版本过新

INSTALL_FAILED_TEST_ONLY                      调用者不被允许测试的测试程序

INSTALL_FAILED_CPU_ABI_INCOMPATIBLE         包含的本机代码不兼容

CPU_ABIINSTALL_FAILED_MISSING_FEATURE       使用了一个无效的特性

INSTALL_FAILED_CONTAINER_ERROR              SD卡访问失败

INSTALL_FAILED_INVALID_INSTALL_LOCATION     无效的安装路径

INSTALL_FAILED_MEDIA_UNAVAILABLE            SD卡不存在

INSTALL_FAILED_INTERNAL_ERROR                系统问题导致安装失败

DEFAULT                                          未知错误

INSTALL_FAILED_VERSION_DOWNGRADE  当前程序的版本低于已安装的程序CPU_ABIINSTALL_FAILED_MISSING_FEATURE   使用了一个无效的特性

安装APK的错误码android源码

安装APK的错误码,定义在android源码中的这个文件中:

frameworks\base\core\java\android\content\pm\PackageManager.java

/**

* if the package is already installed.

* 程序已经存在

*/

public static final int INSTALL_FAILED_ALREADY_EXISTS = -1;

/**

* if the package archive file is invalid.

* 无效的APK

*/

public static final int INSTALL_FAILED_INVALID_APK = -2;

/**

* if the URI passed in is invalid.

* 无效的链接

*/

public static final int INSTALL_FAILED_INVALID_URI = -3;

/**

* if the package manager service found that the device

* didn't have enough storage space to install the app.

* 没有足够的存储空间

*/

public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE = -4;

/**

* if a package is already installed with the same name.

* 已存在同名程序

*/

public static final int INSTALL_FAILED_DUPLICATE_PACKAGE = -5;

/**

* if the requested shared user does not exist.

* 共享用户不存在

*/

public static final int INSTALL_FAILED_NO_SHARED_USER = -6;

/**

* if a previously installed package of the same name has a different signature

* than the new package (and the old package's data was not removed).

* 更新不兼容

*/

public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE = -7;

/**

* if the new package is requested a shared user which is already installed

* on the device and does not have matching signature.

* 共享用户不兼容

*/

public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE = -8;

/**

* if the new package uses a shared library that is not available.

* 共享库已丢失

*/

public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY = -9;

/**

* if the new package uses a shared library that is not available.

* 替换时无法删除

*/

public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE = -10;

/**

* if the new package failed while optimizing and validating its dex files,

* either because there was not enough storage or the validation failed.

* 空间不足或验证失败

*/

public static final int INSTALL_FAILED_DEXOPT = -11;

/**

* if the new package failed because the current SDK version is older than

* that required by the package.

* 系统版本过旧

*/

public static final int INSTALL_FAILED_OLDER_SDK = -12;

/**

* if the new package failed because it contains a content provider with the

* same authority as a provider already installed in the system.

* 存在同名的内容提供者

*/

public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13;

/**

* if the new package failed because the current SDK version is newer than

* that required by the package.

* 系统版本过新

*/

public static final int INSTALL_FAILED_NEWER_SDK = -14;

/**

* if the new package failed because it has specified that it is a test-only

* package and the caller has not supplied the {@link #INSTALL_ALLOW_TEST}

* flag.

* 调用者不被允许测试的测试程序

*/

public static final int INSTALL_FAILED_TEST_ONLY = -15;

/**

* if the package being installed contains native code, but none that is

* compatible with the the device's CPU_ABI.

* 包含的本机代码不兼容CPU_ABI

*/

public static final int INSTALL_FAILED_CPU_ABI_INCOMPATIBLE = -16;

/**

* if the new package uses a feature that is not available.

* 使用了一个无效的特性

*/

public static final int INSTALL_FAILED_MISSING_FEATURE = -17;

// ------ Errors related to sdcard

/**

* if a secure container mount point couldn't be accessed on external media.

* SD卡访问失败

*/

public static final int INSTALL_FAILED_CONTAINER_ERROR = -18;

/**

* if the new package couldn't be installed in the specified install location.

* 无效的安装路径

*/

public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION = -19;

/**

* if the new package couldn't be installed in the specified install

* location because the media is not available.

* SD卡不可用

*/

public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE = -20;

/**

* if the new package couldn't be installed because the verification timed out.

* 验证超时

*/

public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT = -21;

/**

* if the new package couldn't be installed because the verification did not succeed.

* 验证失败

*/

public static final int INSTALL_FAILED_VERIFICATION_FAILURE = -22;

/**

* if the package changed from what the calling program expected.

* 预期的应用被改变

*/

public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23;

/**

* if the parser was given a path that is not a file, or does not end

* with the expected '.apk' extension.

* 解析失败,不是APK

*/

public static final int INSTALL_PARSE_FAILED_NOT_APK = -100;

/**

* if the parser was unable to retrieve the AndroidManifest.xml file.

* 解析失败,无法提取Manifest

*/

public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST = -101;

/**

* if the parser encountered an unexpected exception.

* 解析失败,无法预期的异常

*/

public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION = -102;

/**

* if the parser did not find any certificates in the .apk.

* 解析失败,找不到证书

*/

public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES = -103;

/**

* if the parser found inconsistent certificates on the files in the .apk.

* 解析失败,证书不一致

*/

public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES = -104;

/**

* if the parser encountered a CertificateEncodingException in one of the

* files in the .apk.

* 解析失败,证书编码异常

*/

public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING = -105;

/**

* if the parser encountered a bad or missing package name in the manifest.

* 解析失败,manifest中的包名错误或丢失

*/

public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME = -106;

/**

* if the parser encountered a bad shared user id name in the manifest.

* 解析失败,manifest中的共享用户错误

*/

public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID = -107;

/**

* if the parser encountered some structural problem in the manifest.

* 解析失败,manifest中出现结构性错误

*/

public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED = -108;

/**

* if the parser did not find any actionable tags (instrumentation or application)

* in the manifest.

* 解析失败,manifest中没有actionable tags

*/

public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109;

/**

* if the system failed to install the package because of system issues.

* 系统问题导致安装失败

*/

public static final int INSTALL_FAILED_INTERNAL_ERROR = -110;

parsel安装老是失败_adb安装应用失败,错误码相关推荐

  1. curl下载失败返回0_curl返回常见错误码

    CURLE_OK(0) 成功. CURLE_UNSUPPORTED_PROTOCOL(1) 你的URL传递给libcurl的使用协议,这libcurl的不支持.支持可能是你没有使用一个编译时的选项,它 ...

  2. R星安装不完全无法载入social club(错误码:1)解决办法

    我也尝试了卸载重装,steam修复文件,按照R星官方文档全部弄了一遍也没用,网上找了好多, 终于在贴吧老哥styjkh下成功解决了, 下面是解决办法: win + R → 输入regedit 默认安装 ...

  3. anacoda里面安装包显示失败_CAD卸载不干净?安装老是失败?送你官方卸载工具...

    ▶公告:微信交流群暂停拉群,恢复时间待定 好课推荐: 1.CAD快速入门:点击试听  2.全屋定制连载课:点击试听 工具简介: 很多人遇到过重装CAD,3D等失败的问题,大部分原因是因为原版本没有卸载 ...

  4. 服务器安装2012R2系统失败,windowsserver2012R2安装.net3.5老是提示失败

    系统:windowsserver2012R2 故障描述: 在系统服务器角色里面添加.net framework 3.5提示:请求添加或删除指定服务器上的功能失败,安装一个或多个角色.角色服务或功能失败 ...

  5. office2007安装失败2902_office2007安装失败怎么办?office2007安装失败的解决方法

    最近,一些的朋友在跟小编反映:自己安装安装office2007软件的时候,老是碰到安装失败的情况,安装时提示文件未找到--包含以下文件.不知道是哪个地方出错?那么,office2007安装失败怎么办? ...

  6. sqlsever无法重新启动计算机,安装SQL server 提示重新启动计算机失败怎么处理

    重启计算机后再安装试一下.如果还是失败的话.注册表还存在sql2008的残留信息 这是需要删除的注册表的东西.才能安装. 清空注册表. 1. HKEY_LOCAL_MACHINE\\SYSTEM\\C ...

  7. cuda 安装_win10+VS 2017 安装 CUDA(Visual Studio Integration失败)

    安装参考:windows 10系统nvidia的cuda软件的安装 windows 安装 CUDA可能遇到这个问题:选择自定义安装,但是失败,如下图所示,Visual Studio Integrati ...

  8. server之后安装ssms失败 安装sql_关于SQL安装失败的解决方法

    常见问题解决方法: 本文摘自 " http://zhidao.baidu.com/question/152963021.html?fr=qrl&cid=871&index=1 ...

  9. anacoda里面安装包显示失败_VScode离线安装插件,以及安装插件失败问题

    一直使用VScode,所以在新项目中,领了虚拟机之后,依然使用VScode,但是VScode安装的只是一个工具,里面没有任何插件,没有插件怎么办公啊,所以只能自己安装离线插件了,找了很多方法,终于安装 ...

最新文章

  1. vue插槽样式_Vue为什么要有插槽
  2. vue native
  3. 高精度加法(简明版C语言),高精度加法(简明版C语言)
  4. AI(1 )---人脸识别在各个行业的典型盈利模式
  5. Python空间数据处理环境搭
  6. java: Internal error in the mapping processor: java.lang.NullPointerException问题解决
  7. Ashmem、MemoryFile、Binder的共享内存(jni可用)
  8. 苹果电脑拷贝文件到u盘很慢_小米最硬核U盘!20g,3.1接口,120MB/S读取速度,可连iphone华为...
  9. [网络应用]11款来自 deviantART 的 foobar 2000 皮肤
  10. Tungsten Fabric知识库丨更多组件内部探秘
  11. Android读写日历,android – 读写日历
  12. Windows下编译LibreCAD
  13. 网关短信php,通过ICQ网关发送手机短信的PHP源程序-PHP教程,PHP应用
  14. 蓝桥杯练习系统-基础练习
  15. 浙大愤青郑强教授的演讲(大学生都来看看吧)
  16. Comet OJ - Contest #8 神奇函数(积性函数)
  17. 计算机操作系统属于硬件系统吗,操作系统属于计算机的硬件系统吗
  18. Ext_基本表单_Ext.form.BasicForm
  19. linux字符串删除后几个字符,linux系统删除开头几个字符或者结尾几个字符
  20. 博聊论坛:每日会员免费体育竞猜有奖活动(7月20日第八十四期)

热门文章

  1. 全球对冲基金及其投资策略解析
  2. word怎么删除空白页
  3. 2016年第七届蓝桥杯决赛心得
  4. 快应用中心运营平台项目心得
  5. 如何把多张图片合成视频
  6. POI处理Excel中公式不能自动计算出来的问题
  7. WordPress采集插件:QQWorld收藏家豪华版
  8. Keras深度学习(2)-二分类问题之电影评论分类
  9. Unity3d 中创建实时视频聊天
  10. 使用 Entity Framework Power Tool 报错 0×80070057 解决方法