I would like to write/use an open source script that can access iOS filesystem (non-jailbroken). On a Jailbroken device, i use ssh
/scp
to access, transfer data from the device. Intent is to copy some part of the iOS filesystem (say /var/mobile/Applications/xxx-xxxx/Documents
) to a Mac, from a non-Jailbroken device, using some script. I see that tools like iFunBox is able to do it. Would like to know it manages to do so.
I came across mobiledevice.h but could not really understand how to use it.
Also, would prefer getting this done over USB.. for a jailbroken device, i use tcprelay.py for doing the usb tunneling. Is there something i can use for a non jailbroken device?
The MobileDeviceManager library brings us simple filesystem operations (it's an easy-to-use Objective-C wrapper around the MobileDevice framework you have come across).
The thing is that it doesn't support copying files from the device to the computer, only the other way around. So, in order to work around this issue, I've created a patch (GitHub gist) that you can merge into the included sample program to have it understand the
copyFrom
command.You can install the ifuse tool, which is hosted here: https://github.com/libimobiledevice/ifuse
In order to compile this tool, you will need the a working set of Gnu-tools (make, libtool, etc).
NB: Update your .bash_profile (or similar) to include the following:
The rest of this process should take a few minutes
Install fuse4x
Build the dependencies:
Check out: https://github.com/libimobiledevice/libplist, cd into the checkout, and run:
Check out: https://github.com/libimobiledevice/libusbmuxd, cd into the checkout, and run:
Check out: https://github.com/libimobiledevice/libimobiledevice, cd into the checkout, and run:
(If you're on Linux you'll also need to install usbmuxd, after building libusbmuxd and libimobiledevice. . otherwise, for Windows and OSX . . . )
Now build iFuse:
Check out: https://github.com/libimobiledevice/ifuse
To use ifuse to access your app's documents directory:
Make a mount directory:
Now mount the app's dir:
Where app id is the name what's displayed in the bundle identifier . . example:
(Refer to the attached pic)