对于Android平台的APK文件安装来说,如果安装失败后,则系统会返回一些错误,下面是Android最新版的APK安装返回值,adb install的返回值可能和这个部分有出入,具体可以参考base下cmds的pm相关的执行脚本,分析,下面是目前最新的返回结果,由于Google将PackageManager的installPackage方法移除,下面的返回值也从最新的SDK文档中移除,作为结果参考方便大家查阅Android123整理如下:
int FORWARD_LOCK_PACKAGE
int INSTALL_FAILED_ALREADY_EXISTS
int INSTALL_FAILED_CONFLICTING_PROVIDER
int INSTALL_FAILED_DEXOPT
int INSTALL_FAILED_DUPLICATE_PACKAGE
int INSTALL_FAILED_INSUFFICIENT_STORAGE
int INSTALL_FAILED_INVALID_APK
int INSTALL_FAILED_INVALID_URI
int INSTALL_FAILED_MISSING_SHARED_LIBRARY
int INSTALL_FAILED_NO_SHARED_USER
int INSTALL_FAILED_OLDER_SDK
int INSTALL_FAILED_REPLACE_COULDNT_DELETE
int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE
int INSTALL_FAILED_UPDATE_INCOMPATIBLE
int INSTALL_PARSE_FAILED_BAD_MANIFEST
int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME
int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID
int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING
int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES
int INSTALL_PARSE_FAILED_MANIFEST_EMPTY
int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
int INSTALL_PARSE_FAILED_NOT_APK
int INSTALL_PARSE_FAILED_NO_CERTIFICATES
int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION
int INSTALL_SUCCEEDED
int REPLACE_EXISTING_PACKAGE
RSS