TUTORIAL: quickly finding in which directory a given application resides on your iPhone

There can be several cases when you want to access the home (installation) directories of some of your installed (non-Cydia) applications. This can be pretty hard as the directory containing them /private/var/mobile/Applications, has cryptic subdirectory names.

There may be several reasons for doing so:

- You can have direct access to the configuration files of a given app (for example, the data files of your third-party Web browser for quick manual editing to quickly import / export favorites when needed) (Note: as far as the best Web browser, iCab Mobile is concerned, it has mass favorite export/import capabilities via a wireless connection)

- You’d like to transfer the files saved from, say, the great Web browser iCab Mobile or the radio streams recorded by the radio streamer apps FStream or the just-released version of Pocket Tunes. (Note: the former two apps allow for accessing these files via a wireless connection via their built-in Web server; see [Settings icon / ] Export/Import / Start Server in iCab Mobile and More / Web : Web Management / Server Activation: Activated in FStream.)

- You’d like to add additional games to, say, the great emulator C64. (Other, exclusively Cydia-based emulators developed / ported by for example zottd use a directory under /private/var/mobile/Media/; that is, with them, you don’t need to hunt for the home directory. Note that Cydia-based programs install themselves under /private/var/stash/Applications instead)

There are several ways of combating this problem.

One is just transferring the entire directory structure under /private/var/mobile/Applications to your desktop computer and there either use a filesystem search tool (e.g., Alt-F7 in Total Commander) or just dumping the directory list, including subdirectories, with a dir /s >dirlist command. Copying the entire directory structure, unfortunately, is very time-consuming and keeping it synchronized is also a nightmare (you need to manually find the new directories of recently-added programs and transfer them yourself if you stick with Total Commander’s T-PoT; if you use other means of directory synchronization, the situation may be somewhat better).

A much better choice is just generating the directory list on your phone and transfer in to your desktop for quick directory name lookups.

To make your life much easier, I’ve made a video of how this is done. It’s HERE (click the link to see the video!). In a nutshell:

1. Install MobileTerminal from Cydia:

(this isn’t in the video)

2. Start it

3. Enter “cd Applications”; make sure you capitalize the first A. (Alternatively, you can use the built-in “Tab” support by just entering e.g. cd Ap and, then, make a swiping gesture on the screen towards the lower right corner. I also do this on the video to avoid having to enter the entire directory name..

4. Enter ls -R >dirlist (you can use any other name instead of "dirlist"; for example, in the screenshot below, I used "diirr"). There are two ways of accessing the > character. One is just using the on-screen keyboard (as usual): tap .123 and, then, the #+= button. If, on the other hand, you would like to use MobileTerminal more (for other tasks as well), you’ll want to learn its shortcut menu. To get the > character from there, just tap and hold the screen and, when the square context menu (the one with the three times three rows/columns) is displayed, without releasing your finger, slide down to the bottom right icon (;~)). When the contents of the underlying context menu changes to simple characters, just slide your finger to the top right corner (to > ). Then, release your finger.

A shot of the command:

Note that in the last few seconds of the demo video linked to above, I show how this is done.

5. Wait until it finishes running.

6. Transfer the newly-created file (in this case, /private/var/mobile/Applications/dirlist) to your desktop.

7. With an in-file search tool (e.g. F3 in Total Commander), search for the program name (without spaces); for example, “PocketTunes”. You’ll see something like this:

Look for the long hexadecimal number preceding all this; here, it’s “B5C31D23-057B-48BF-9165-D98481F104F2” (it's on the top of the window in this case). Once you know this, it’ll be very easy to locate the given directory; for example, if you use the great T-PoT plug-in with Total Commander, all you need to go to \private\var\mobile\Applications\, hold down Shift and Alt and enter B5. Then, the cursor will directly be positioned to the first occurrence of keys starting with B5. If there are more than one keys starting with B5, you can go on entering more characters; for example, B5C3.

Now, you’ve found the app directory you looked for :)

Master your iPhone in one minute a day: Sign up here to get our FREE Tip of the Day delivered right to your inbox.

<p>Werner Ruotsalainen is an iOS and Java programming lecturer who is well-versed in programming, hacking, operating systems, and programming languages. Werner tries to generate unique articles on subjects not widely discussed. Some of his articles are highly technical and are intended for other programmers and coders.</p>
<p>Werner also is interested in photography and videography. He is a frequent contributor to not only mobile and computing publications, but also photo and video forums. He loves swimming, skiing, going to the gym, and using his iPads. English is one of several languages he speaks.</p>