iPad TUTORIAL: Use symlinks to make your external storage card truly useful! (long)

Discussion in 'Jailbreaks and iOS Hacks' started by Menneisyys2, Oct 8, 2012.

  1. Menneisyys2, Oct 8, 2012
    Last edited: Oct 8, 2012

    Menneisyys2 macrumors 603

    Joined:
    Jun 7, 2011
    #1
    Guys, here's another of my tutorials - this time on making the CCK highly useful. Hope you'll find it useful - after all, symlinks are a godsend for everybody with restricted storage OR the need for, say, quickly reviewing RAW shots.

    TUTORIAL: This is how you can use your memory card in AppStore apps as external iPad storage memory

    Ever envied Android / Symbian / BlackBerry / Windows Mobile (and even the forthcoming Windows Phone 8) users because of the freedom they have because of the storage cards? Now, you'll get an answer!

    I've continuously been asked (see for example THIS and THIS) about how you can play back videos residing solely on an external, Camera Connection Kit (CCK)-compliant (that is, an SD card or a micro/mini one with an adapter) storage card - or a compatible USB memory key. Up until now, I've always referred my readers to articles / videos like THIS and THIS (see the bullet starting with "Ripped movies: if you have any ripped movies or personal videos, you can use the CCK to add extra storage to the iPad"). Unfortunately, tutorials targeted at jailbroken users (for example, THIS one) haven't used symbolic links (the “magic” we'll make use of) either, meaning they relied on the built-in video / image viewer of iFile. The multimedia support of the latter isn't anything to write home about – it can only play back native iOS formats and has absolutely no advanced features.

    Today, while answering the same question over at DPReview (thread), I re-tested the best player for jailbroken devices, XBMC, only to find out it can't access the external memory card either, as opposed to what I had thought. (For geeks: it's, under Videos > Files > Add Videos... > Browse > Home folder, by default, only allowed to access /var/mobile, while the storage card is auto-mapped to /var/mnt/mount1.) This means only the not-so-great RushPlayer+ is able to natively access the card (as it can go up the directory hierarchy even to the root) and nothing else. This is unacceptable, thought I, and immediately started playing with so-called “symbolic links” to the card folder (something under /var/mnt/mount1), created in the Document folders of official AppStore apps (the one third-party video players access their videos).

    I was right – everything works as expected, you don't need to pre-transfer the videos for playback (unlike with the previous approaches) and you can use any(!!!) third-party player, even feature-packed ones like “It's Playing” (my favourite player because of the DSP's). What is more,

    1, you don't need any special app to create these links, let alone typing command-line commands in the Terminal

    2, symbolic links are hidden when you remove the card but restored when you reinsert it. This means you only need to create a link once and don't end up having to do the same when you reinsert the card.

    3, you can access the same directory from any number of applications. (Technically, you can create a symbolic link any number of times, from anywhere.)

    Of course, the solution isn't as elegant as a card not protruding out from the iPad but, after all, still much-much better than nothing at all – and, of course, the method used so far, explained in the above linked tutorials: 1, making sure all your video files are iDevice-native (no MKV's, no AVI's etc.) 2, naming your video files to have a 8-character name only 3, (sometimes lengthy) importing them before the playback.

    OK, enough of the talk, let's see how this all needs to be done! As you'll see, it's really easy – basically, if you're able to jailbreak your iPad, you'll also be able to follow and learn the workflow I present below.

    NOTE:

    1, while I show you the link creation in a media player's Documents folder (and also show the results in two other players, It's Playing and XBMC), you can do the same with any kind of an AppStore (or Cydia) app, as long as it imports / stores its documents from / in its Documents folder. Image viewers / editor (yes, you can directly access your RAW shots directly, while on the card! This is great news for all photographers equiped with iPads!), music apps, anything. It's because storing (large) video files on external cards that is mostly asked for that I use two multimedia players in this tutorial. Again, any other kind of official AppStore app would be able to directly access files on the storage card after creating a symlink to it (or a directory on it).

    2, as with the best apps and tweaks, this all only works on jailbroken devices. Sorry guys – it seems, “thanks” to Apple's overly strict restrictions, one does need to jailbreak his or her iDevices to make their usage as seamless, quick and effective as possible. As they should, I should add.

    Creating links

    First and foremost, you'll need the excellent file handler tool iFile, available from Cydia:
    [​IMG]
    (as with all (except the bottom-most iPhone one) the screenshots in this article, click the thumbnail image for a much cleaner and larger version. I must use bad-quality, small thumbnails not to mess up the layout of the article when rendered and not to tax one's data plan too much)

    I think even the free version of iFile is capable of creating symlinks – I couldn't test this because I, as you can also see in the screenshot above, purchased iFile and couldn't test the free version in this regard.

    Before starting to create symlinks, you'll also need to insert the card with your videos (or at least a directory where your'll later put your videos), via the CCK, in your iPad. If the card has a DCIM subdirectory with images / videos in it (it doesn't have to be present), the default image importer will be executed; just exit it.

    Start up iFile and tap “Flash Drive” in the top left corner, also annotated in the following screenshot. The right pane will change to the folder “/var/mnt/mount1” (see the top banner).

    [​IMG]

    The directory list in this shot shows a directory “myownvideos” (the one I'll link to and containing all my videos) and two other files, created by OS X, we can just ignore.

    Now, tap the “Edit” button in the top right corner (also annotated above). Round checkboxes will appear in front of every row (annotated below):

    [​IMG]

    Tap the one in front of the directory you'd like to link to (in our case, “myownvideos”):

    [​IMG]

    Tap the clipboard icon in the bottom right corner (annotated below). A context menu will be displayed; tap “Copy/Link” in it (also annotated below):

    [​IMG]

    Tap “Applications” in the left center (annotated below) and scroll down to the app you'd like to create the symlink in. In my example, it's “GoodPlayer” (also annotated). Tap it:

    [​IMG]

    Inside, tap the “Documents” folder (annotated below) so that you can step into it:

    [​IMG]

    Inside the “Documents” folder, tap the “Edit” button (upper right corner) as you've done in the first iFile screenshot and, after that, tap the clipboard button (lower right corner; annotated below). Select “Create Link” from the context menu (annotated below). After that, tap Done (upper right corner; also annotated):

    [​IMG]

    The new directory listing will contain the name of the target (linked) directory; in our case, “myownvideos” (annotated below):

    [​IMG]

    Now, you can start the app where you've created the link at; in our case, GoodPlayer. It'll list the just-created link as a standard, tappable folder:

    [​IMG]

    Tap it: its contents will be listed, ready for tapping (=playback):

    [​IMG]

    Let's do the same to It's Playing. The linked directory result:

    [​IMG]

    let's enter the directory and play back a video:

    [​IMG]

    Finally, a shot of XBMC entering the Documents directory of GoodPlayer. From there, it has no problems with playing back symlinked content either:

    [​IMG]

    What about the iPhone?

    Unfortunately, the only CCK-specific hack for the iPhone / iPod touch, CameraConnector, only allows for using external USB keyboards (and probably some other input devices) with these devices.

    [​IMG]
    (The Cydia main page of CameraConnector, also showing I've purchased it)

    Not even the current, 0.0.2-1 version allows for mapping in external mass storage – don't even try.

    (Also see my posts HERE if interested in the tweak.)
     
  2. Cptnodegard macrumors 6502

    Joined:
    Jan 17, 2013
  3. Menneisyys2, Apr 21, 2013
    Last edited: Apr 21, 2013

    Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #3
    1, while the tutorial above explains doing this to map external directories / files to AppStore apps, symlinking can also be VERY useful between the Documents directory (or other file storage folders) AppStore apps. An example: you transfer a huge (multi-Gigabyte) video to, say, It's Playing (because of its excellent volume / brightness / color boosting capabilities), but would like to play back the same video in, say, nPlayer. (Because the latter supports, among other things, displaying multiple subtitle tracks at the same time.) Then, instead of duplicating the file or cutting / pasting (moving) it from the source player's Documents directory to that of the target player, you just create a small symlink in the Documents directory of the latter, pointing to the one and only video file. This makes it possible to access the same file from any number of players.

    I wish Apple implemented something like this with manual, user-initiated, mutual (!) negotiation between the two apps. (Of course I know they won't.)

    2, The latest version (0.0.2d3-3) of CameraConnector (see the latest part of my original post) might support external FAT32 storage devices - with some manual setup each time(?) you connect the storage:

    [​IMG]

    Will definitely test the new version and report back.

    (Dedicated thread: http://forums.macrumors.com/showthread.php?t=1573396 )

    3, at DPReview, I've written a quick tutorial on how you can directly review and delete photos off your storage cards using this hack via BUZZ Player 4. See THIS.
     
  4. DSF macrumors member

    Joined:
    Apr 12, 2013
    #4
    Menneisyys2 hi!

    Thanks for this topic! Neat idea with the symbolic links. Just shared 1 video folder between 2 appstore players.

    Ps: I remember you since the Windows Mobile era (from xda developers or modaco). Remembered your detailed WM java platforms comparison article :p.
     
  5. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #5
    As I've promised in my yesterday's update, I've played quite a bit with the current, 0.0.2d3-3 version of CameraConnector to find out whether it indeed can be used to access storage cards.

    It turned out to contain the compiled "winocm / ios-usb-framework" libraries (no source available) at https://github.com/winocm/ios-usb-framework/tree/master/USB_MSC/PictureImport

    The answer so far is nope - at least not that I know of. I couldn't make either my iPads or my iPhones display the Vendor / Product ID's of my card in my CCK - which was perfectly visible to the importer utility of even non-jailbroken iPads.

    Note: you'll need "IOKit Tools" (available in Cydia) to issue the recommended "ioreg-p IOUSB-fl" command.

    Note 2: I've only found one discussion of this subject, on a(n in)famous Russian PDA site. (I don't link to it as it has cracked software.) One of the participants, "Мастер Йогурт", stated he was able to obtain the pid / vid's of his card but not even they worked when providing "usb_cp" with these values.

    Another guy, "sashapont", stated he talked to the developer on the matter but haven't received any meaningful / useful answer.

    Note 3: even if you do make it work, you won't be able to create symlinks to these files. It seems you can only list (usb_ls) and copy (usb_cp) those files. In this regard, accessing the card is almost as restricted as without jailbreaking - you must transfer your files to the main storage before accessing them (from, say, a video player).
     
  6. gwyyp macrumors newbie

    Joined:
    May 24, 2013
    #6
    thank you!!!

    I joined MacRumors just to thank you for this info.

    I've been trying to figure out a way to do this since I got my iPad. Thanks so much!

    BTW, your method works with PlayerXtreme as well
     
  7. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #7
    1. You're welcome :)

    2. Yup, I also use it to share huge, multi-Gigabyte video files between AppStore players like It's Playing and nPlayer.
     
  8. felixpro macrumors newbie

    Joined:
    Jan 20, 2014
    #8
    exFat

    Hi,

    Will iFile let me mount exFat SDXC card? I had no problem following your tutorial for Fat 32 formatted SDXC card, but iFile will not even see the same card if I will reformat it with exFat.

    Please, let me know.
    Thank you.
     
  9. jigen11 macrumors newbie

    Joined:
    Nov 2, 2014
    #9
    Hi Menneisyys2, thanks you so much for this awesome tutorial.
    I've bought an ipad air and a cck adapter to which i'm going to put an sd full of my videos, photos, ebooks etc...
    Now i need an app for images album that can work with symlinks, any suggestions?
    I know that it can be done using ifile browser but i was wondering if there were an app like the ios one.
    Is there also an app for music?
    Finally, what's the best app to play video (mkv,mpeg,avi,divx,wmv,etc) directly from the sd card?
    Thanks you again and please forgive my bad english :eek:
     
  10. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #10
    It seems iOS7 has changed symlink / exFAT / FAT support - that is, to my knowledge, symlinking no longer works in anything newer than iOS6. I haven't had the time to investigate this further.
     
  11. jigen11 macrumors newbie

    Joined:
    Nov 2, 2014
    #11
    oh, so sad!
    I couldn't test it yet because the cck adaptor is not arrived.
    By ifile can I play music and picture anyway ? If I download apps from cydia, symlinks will work or will be the same app store ones issue?
    Thanks
     
  12. jigen11 macrumors newbie

    Joined:
    Nov 2, 2014
    #12
    Are there any alternatives to this method? if I buy a wireless storage it'll work for playback video?
     

Share This Page