title: adb install fails with error 'INSTALL_FAILED_INSUFFICIENT_STORAGE'
body: <p>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 <a href="http://talk.sonymobile.com/t5/Xperia-M-M-dual/Can-t-move-apps-from-intenal-memory-to-sd-card/td-p/355820">link</a> for details.</p>
  
  <p>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.</p>
  
  <p>My Android Details of Sony Xperia M is listed below</p>
  
  <pre><code>Model number C1904
  Android version 4.1.2
  Build number 15.1.C.2.8
  </code></pre>
  
  <p>I have tried running the below commands from some forum and it is not working for me,</p>
  
  <pre><code>adb devices
  adb shell pm get-install-location
  adb shell pm set-install-location 2
  </code></pre>
  
  <p>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.</p>
  
  <p>I have tried '<strong>apps2sd</strong>' utility to move my apps and it is showing the below error,</p>
  
  <pre><code>'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.'
  </code></pre>
  
  <p>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,</p>
  
  <pre><code>adb install -s C:\com.furkan0gul.mvanparking.apk
  </code></pre>
  
  <p>The above command fails with this error,</p>
  
  <pre><code>3531 KB/s (13523837 bytes in 3.740s)
          pkg: /sdcard/tmp/com.furkan0gul.mvanparking.apk
  Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
  </code></pre>
  
  <p>I have enough space (more than 6GB out of total 8GB memory) in my external card. You can find this using below command,</p>
  
  <pre><code>&gt;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
  </code></pre>
  
  <p>If I run the <strong>adb</strong> install command without '-s' switch, it installs fine in internal memory without any issues as below,</p>
  
  <pre><code>&gt; adb install C:\com.furkan0gul.mvanparking.apk
  2549 KB/s (13523837 bytes in 5.180s)
          pkg: /data/local/tmp/com.furkan0gul.mvanparking.apk
  Success
  </code></pre>
  
  <p>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 '<strong>INSTALL_FAILED_INSUFFICIENT_STORAGE</strong>' 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.</p>
  
  <p>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.</p>
  
  <p>Appreciate if some one could send your ideas on this.</p>