9/08/2013

Retrieve SD Card Mounted Path

Sometimes we want to set/get the external storage root path as global variable in Tasker, no matter which ROM we flash or update. Next time when you want to use file path in SD card, just use variable %MNT_SD as path prefix.

You can do it like this:

Profile:(Device Boot)

Context: "Event -> Device Boot"

Task: 1. "Wait[5 seconds]";

            /*wait 5 seconds to let system initialize some settings*/

      2. "Run Shell(use root)
                      [Command: cat /system/etc/vold.fstab | busybox grep "sdcard" | busybox awk '{printf $3}'

                       Use Root: check;
                       
                       Store Output In: %MNT_SD ]"

"Run Shell" action configure:


vold.fstab file in MIUI(/system/etc/):



Note: I had test it on my MiOneS phone(MIUI ROM). More info about vold.fstab file, please refer here.

No comments:

Post a Comment