android adb install 错误类型解析 PartI

通过USB链接PC 和 android设备, 使用命令adb -s xxx install xxx.apk, 遇到过的错误类型及解析

1. INSTALL_FAILED_MEDIA_UNAVAILABLE

安装位置不可得。 这时去到手机的shell下, adb -s xxx shell -> cd /sdcard 时, 会出现 "Permission denied"的错误。

sdcard现在处于unmounted状态。 通常插拔下usb链接, 就可以安装了。

实际上, 安装位置是可以设置的。

对于手机而言, pm get-install-location, 可以得到, 手机的安装位置设置。

pm get-install-location: returns the current install location.
    0 [auto]: Let system decide the best location
    1 [internal]: Install on internal device storage
    2 [external]: Install on external media

另外, manifest.xml中的安装位置选项:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:installLocation="preferExternal"
    ... >

"If you do notdeclare this attribute, your application will be installed on the internal storage only and it cannot be moved to the external storage." as said in http://developer.android.com/guide/topics/data/install-location.html

If you declare "preferExternal", you request that your application be installed on the external storage, but the system does not guarantee that your application will be installed on the external storage.



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值