Accessing the iPhone filesystem from a Mac OS X ap

2019-01-23 19:51发布

问题:

I need to get a file (sms.db) from an iPhone connected to a Mac. I cannot find any way to access the iPhone filesystem searching in Apple Developers Connection...

I cannot SSH to the iPhone, the application I want to develop is meant to be used on non-jailbroken iPhones... And I would like to avoid some MacFuse modules I found googling, too... I would like to access the filesystem thru some sort of API, the simpler the better.

Thanks!

回答1:

There is no Apple-documented public API for accessing the entire filesystem on a stock OS iOS device. Even private OS/API calls won't work due to the app sandbox restrictions.

Xcode, iTunes, and probably other apps that take over the iTunes USB driver, are using a non-Apple-documented private API that only works over the USB connection.



回答2:

This api was developed to allow access to ios devices:

http://www.libimobiledevice.org/



回答3:

It appears that DiskAid silences all nay sayers. That app seems to have complete access to the iOS device filesystem - whether or not iTunes is running and whether or not the files are shared. It even sees files down to root level. I am still trying to figure out how it is done. Oh yea, this is all on a non jailbroken device.



回答4:

It is not possible for non-jailbroken iPhone due to file system restrictions.



回答5:

You can't access the filesystem from an OSX application, the filesystem is locked down.



回答6:

Phoneview (as mentioned in a few comments) does not allow access to the file system. It uses public APIs to get things like call data and contacts, and allows you to copy files into one location on the phone.

From the FAQ: "PhoneView will store your files in the media section of the iPhone's disk"

Smoke and mirrors.



回答7:

If it's for your own app, use the document sharing included in iOS 4.x. You can then have files show up in iTunes, and drop files from the desktop into your app's section.

A tutorial is found here: Ray Wenderlich's nice tutorial