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_securewhere not evenroothas access to (I tested it on my device, you can't evencdto that folder). – GiantTree Apr 20 '15 at 18:49sdcard_rwbelong to therootgroup or feature the usersdcard_rwat 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/sdcard0gave me thislrwxrwxrwx root root 2015-04-20 15:59 sdcard0 -> /storage/emulated/legacyand 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/legacypoints at. The other result is an "easy fix": First you need to move the originalAndroidfolder to another location or rename it, to make space for the symlink. Then link/storage/sdcard1/Androidto/storage/sdcard0/Androidand 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 themvlol) thenrm -r /storage/sdcard0/Androidthenln -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:19Androidit 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:31Androidfolders are missing, it recreates them a moment later. this is also why applications like Link2SD link individual app's folders instead of the wholeAndroidfolder. 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 mysdcard1is fat32 formatted. To what should I format it (I mean its main partition)? – pr.nizar Apr 20 '15 at 19:52fusemight not permit you to create a symlink to your external SD card). If you can, try formatting your SD card asext4so permissions can be applied without usingfuseas an intermediate permission manager, that blocks most read and write attempts without proper package permission. – GiantTree Apr 20 '15 at 19:58rootcan create symlinks. Keep that in mind. – GiantTree Apr 21 '15 at 13:20