I have a Moto G (2nd generation) with Android 5.02 on it. Internal SD card is about 8Gb and I have an external SD card with 16Gb free space.
Moving application to SDCARD from the application's menu moves it to sdcard0 which is the internal SD card.
Adb shell command:
pm get-install-location
gives me:
0[auto]
I tried to set installation location through:
pm set-install-location 2
But I'm getting this error:
Error: java.lang.SecurityException: Package android does not belong to 2000
That is I believe complaining about root permissions.
And because it's a production build trying:
adb root
gives me:
adbd cannot run as root in production builds
Is there any way to set the applications install their data to external SD card?
P.S: I don't want to install a custom rom or install third party software to root the phone.
Edit:
I've noticed that applications data was stored in the folder /storage/sdcard0/Android
, so I thought of moving this folder to /storage/sdcard1/
and creating a symlink this way instead:
ln -s /storage/sdcard1/Android /storage/sdcard0/Android
will this do the job?
Thank you.
/sdcard/sdcard0/Android
. Applications are stored in a hidden folder called.android_secure
where not evenroot
has access to (I tested it on my device, you can't evencd
to that folder). – GiantTree Apr 20 '15 at 18:49sdcard_rw
belong to theroot
group or feature the usersdcard_rw
at all. But with a bit of permission changes you should be able to get that sorted out. – GiantTree Apr 20 '15 at 19:00ls -l /storage/sdcard0
gave me thislrwxrwxrwx root root 2015-04-20 15:59 sdcard0 -> /storage/emulated/legacy
and runningls -l /storage/sdcard0/
gave me thisdrwxrwx--x root sdcard_r 2014-12-20 18:16 Android
.. Is that a good or bad news? Since I'm not root I believe I can not set permissions. – pr.nizar Apr 20 '15 at 19:06/data/media
, wherestorage/emulated/legacy
points at. The other result is an "easy fix": First you need to move the originalAndroid
folder to another location or rename it, to make space for the symlink. Then link/storage/sdcard1/Android
to/storage/sdcard0/Android
and name the linkAndroid
. At last fix all permissions (777). This is just theoretical but I imagine it should work like this. – GiantTree Apr 20 '15 at 19:13cp -R /storage/sdcard0/Android /storage/sdcard1/
(too shaky about themv
lol) thenrm -r /storage/sdcard0/Android
thenln -s /storage/sdcard1/Android /storage/sdcard0/Android
. If this works the credit goes to you so you may update your answer. I'll let you know! ;-) – pr.nizar Apr 20 '15 at 19:19Android
it will break all running apps (or at least most of them). It's just a theoretical approach off of my head; nothing to exactly follow. If you are quick enough, you may be able to recover apps after crashing but keep in mind that all actions are undone after the next reboot. – GiantTree Apr 20 '15 at 19:25ln: /storage/sdcard0/Android: Operation not permitted
. So the next question is how to create a symlink? (I reverted my changes and all is fine.. or so I think for now! lol) – pr.nizar Apr 20 '15 at 19:31Android
folders are missing, it recreates them a moment later. this is also why applications like Link2SD link individual app's folders instead of the wholeAndroid
folder. You can try that, but I can't promise success. – GiantTree Apr 20 '15 at 19:35Operation not permitted
). I believe it's simply because mysdcard1
is fat32 formatted. To what should I format it (I mean its main partition)? – pr.nizar Apr 20 '15 at 19:52fuse
might not permit you to create a symlink to your external SD card). If you can, try formatting your SD card asext4
so permissions can be applied without usingfuse
as an intermediate permission manager, that blocks most read and write attempts without proper package permission. – GiantTree Apr 20 '15 at 19:58root
can create symlinks. Keep that in mind. – GiantTree Apr 21 '15 at 13:20