[英]adb install fails with error 'INSTALL_FAILED_INSUFFICIENT_STORAGE'
I have bought my first Android mobile Sony Xperia M without being aware of the issue that we can't move apps to external sd card. 我已经购买了我的第一部Android手机索尼Xperia M而没有意识到我们无法将应用程序移动到外部SD卡的问题。 Refer this link for details. 有关详情,请参阅此链接 。
The only thing Sony advice is to root the device, partition and use third party apps to move it. 索尼的唯一建议是根据设备,分区并使用第三方应用来移动设备。 They also mention that rooting may void warranty. 他们还提到生根可能会使保修失效。
My Android Details of Sony Xperia M is listed below 我的Android Xperia M详细信息如下所列
Model number C1904
Android version 4.1.2
Build number 15.1.C.2.8
I have tried running the below commands from some forum and it is not working for me, 我试过从一些论坛运行以下命令,它对我不起作用,
adb devices
adb shell pm get-install-location
adb shell pm set-install-location 2
Though the above commands doesn't prompt any error and I can get the install location as 2 (with adb shell pm get-install-location). 虽然上面的命令没有提示任何错误,但我可以将安装位置设置为2(使用adb shell pm get-install-location)。 So I believe it has set properly. 所以我相信它设置得当。 But then I tried installing some apps and it is only installing in the internal memory only. 但后来我尝试安装一些应用程序,它只安装在内部存储器中。
I have tried ' apps2sd ' utility to move my apps and it is showing the below error, 我试过' apps2sd '实用程序移动我的应用程序,它显示以下错误,
'The device does not have a real primary external storage, or the primary external storage is emulated. Moving app to SD function cannot be supported by this device.'
Finally from another forum, I understand that we can install apk files through 'adb install' command to install directly into the sd card as below, 最后来自另一个论坛,我了解到我们可以通过'adb install'命令安装apk文件直接安装到sd卡中,如下所示,
adb install -s C:\com.furkan0gul.mvanparking.apk
The above command fails with this error, 上面的命令失败,出现此错误,
3531 KB/s (13523837 bytes in 3.740s)
pkg: /sdcard/tmp/com.furkan0gul.mvanparking.apk
Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
I have enough space (more than 6GB out of total 8GB memory) in my external card. 我的外卡中有足够的空间(总共8GB内存超过6GB)。 You can find this using below command, 你可以使用下面的命令找到它,
>adb shell df
Filesystem Size Used Free Blksize
/dev 402M 64K 402M 4096
/mnt/asec 402M 0K 402M 4096
/mnt/obb 402M 0K 402M 4096
/system 1183M 907M 275M 4096
/cache 246M 4M 241M 4096
/persist 3M 80K 3M 4096
/firmware 63M 43M 19M 16384
/data 2101M 1401M 700M 4096
/lta-label 15M 4M 10M 4096
/storage/sdcard0 2101M 1401M 700M 4096
/storage/sdcard1 7572M 1088M 6483M 32768
If I run the adb install command without '-s' switch, it installs fine in internal memory without any issues as below, 如果我在没有'-s'开关的情况下运行adb install命令,它会在内部存储器中安装正常,没有任何问题,如下所示,
> adb install C:\com.furkan0gul.mvanparking.apk
2549 KB/s (13523837 bytes in 5.180s)
pkg: /data/local/tmp/com.furkan0gul.mvanparking.apk
Success
While installing to sd card, app seems to be installed in '/sdcard', but no mount of such thing there in 'df' command output. 在安装到SD卡时,app似乎安装在'/ sdcard'中,但在'df'命令输出中没有安装这样的东西。 Also tried searching this ' INSTALL_FAILED_INSUFFICIENT_STORAGE ' by google. 还尝试通过谷歌搜索此“ INSTALL_FAILED_INSUFFICIENT_STORAGE ”。 Most of them asked to do some changes in emulator to get this done. 他们中的大多数人都要求在模拟器中做一些更改才能完成这项工作。 I have uninstalled the app, restarted the device and tried installing again into sd card but not working ended with the same insufficient storage error. 我已经卸载了应用程序,重新启动了设备,并尝试再次安装到SD卡但不能正常工作以相同的不足存储错误结束。
I am not using emulator. 我没有使用模拟器。 I am just directly installing apk into my sd card. 我只是直接安装apk到我的SD卡。 I dont want to root the device and void warranty offer. 我不想根植设备并使保修提供无效。
Appreciate if some one could send your ideas on this. 感谢有人可以就此发表您的想法。
There is a simple workaround.If your test device is running Android 2.2 or later then add the 有一个简单的解决方法。如果您的测试设备运行Android 2.2或更高版本,然后添加
android:installLocation
attribute to your application's manifest file, with the value "preferExternal". 属性到应用程序的清单文件,值为“preferExternal”。 This will force the app to be installed on the device's external storage, such as a phone's SD card. 这将强制将应用程序安装在设备的外部存储设备上,例如手机的SD卡。
For example: 例如:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dem"
android:installLocation="preferExternal">
I have a Fairphone (first edition) with applied unified storage. 我有一个应用统一存储的Fairphone(第一版)。 The INSTALL_FAILED_INSUFFICIENT_STORAGE problem should have been gone with the unified storage. INSTALL_FAILED_INSUFFICIENT_STORAGE问题应该已经与统一存储一起消失了。 Nevertheless, it showed up after a few month despite having 12gb of free disk space. 然而,尽管有12GB的可用磁盘空间,它在几个月后出现了。 For me, the following steps solved the issue 对我来说,以下步骤解决了这个问题
Since I HAVE enough space on the internal memory, this is preferred over the external memory (which I probably don't have anymore due to the unified storage). 由于我在内部存储器上有足够的空间,因此优于外部存储器(由于统一存储,我可能不再使用它)。 This might be specific to the Fairphone 这可能是Fairphone特有的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.