adb install fails with error 'INSTALL_FAILED_INSUFFICIENT_STORAGE'
Asked Answered
P

2

7

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. 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

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). 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,

'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 -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. 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,

> 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. Also tried searching this 'INSTALL_FAILED_INSUFFICIENT_STORAGE' by google. 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.

I am not using emulator. I am just directly installing apk into my sd card. I dont want to root the device and void warranty offer.

Appreciate if some one could send your ideas on this.

Phycomycete answered 17/4, 2014 at 5:13 Comment(1)
possible duplicate of Solution to INSTALL_FAILED_INSUFFICIENT_STORAGE error on AndroidHectoliter
B
4

There is a simple workaround.If your test device is running Android 2.2 or later then add the

android:installLocation 

attribute to your application's manifest file, with the value "preferExternal". This will force the app to be installed on the device's external storage, such as a phone's SD card.

For example:

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.dem"
    android:installLocation="preferExternal">
Berliner answered 17/4, 2014 at 5:21 Comment(9)
I am just downloading apk files and tried installing the same into my actual device (not a testing device). I am not sure how to change app manifest file ? Can you please give detail instruction. Please note that I am not the developer of this app.Phycomycete
Some tips to free space: Go to Settings, Applications, Manage Applications, click "Move to SD card" on the ones that have that option. In the same list, also click "Clear Cache" on all your apps. Your browser cache can not be cleared here, so open your browser, go to Settings, and click "Clear cache".Berliner
then you can install your new .apk file. hope t will help you.Berliner
Already tried clearing cache data of apps and move my images, videos to sd card and tried the same. Still same error only.Phycomycete
Please let me know how much your internal storage space left.Is it less then apk file size?Berliner
I have 824MB free in my internal storage. The app is around 13MB size. My SD Card has 6.33GB free storage. Do you have any idea where /sdcard will be as mount point ?. I don't see it using adb shell df command..Phycomycete
Try this command to change installation location to sdcard: adb shell pm set-install-location 2Berliner
I have done that already and mentioned in my first post itself. Though the command doesn't prompt error, apps installed only in internal memory instead of sd card after running the command.Phycomycete
STill fails. either same error or cannot locate mediaTetraspore
O
0

I have a Fairphone (first edition) with applied unified storage. The INSTALL_FAILED_INSUFFICIENT_STORAGE problem should have been gone with the unified storage. Nevertheless, it showed up after a few month despite having 12gb of free disk space. For me, the following steps solved the issue

  1. Install an ssh server on your phone
  2. Login
  3. su (in case you're not root)
  4. pm set-install-location 1 (set to external memory)

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

Orbit answered 19/11, 2014 at 22:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.