Accessing the iPhone filesystem from a Mac OS X application - iphone

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!

This api was developed to allow access to ios devices:
http://www.libimobiledevice.org/

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.

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.

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

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

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.

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

Related

iPhone SDK Modify WiFi Settings

I need to be able to modify the WiFi settings on a iOS device (iPhone and iPad), most of the libraries are found so far via google search are private libs... Apple don't like this, does the SDK allow this in another way?
Thanks
Without jail breaking the device, you cannot modify the Wi-Fi settings. This is because all iOS applications are sandboxed, meaning they only have access to the data Apple allow deems necessary to the functioning of the app. For iOS apps, the documents directory constitutes the application's sandbox and the application cannot create or modify files or directories outside of these directories. So even if you found a way to modify Wi-Fi settings, your app would be rejected by Apple. Hope this helps!
Apple does not expose any public APIs that allow you to do this.

Access iOS app documents directory from OS X

I'm working on an iOS app that creates some files and saves it in its documents directory. It would be really helpful for this app if I could create an OS X app that could access that apps documents directory as well as the pictures on the device. I know it's possible because of this app, but I can't seem to find a way to implement it. The iOS app does need to be approved by apple, but the desktop app doesn't. With these apps I am targeting non-jailbroken iOS 5 devices and OS X Lion. Any ideas on how I could do this?
A few other solutions I am considering:
upload the apps documents directory to iCloud and then download it on the desktop
upload to dropbox for auto syncing
make the desktop app into a server and upload from the app to the desktop over the network
Those are all backup solutions, but it would be great if I could do this without having to depend on the network.
Take a look at: libimobiledevice. It's a library designed just for that. Anyway, all of this is not supported by Apple, as there isn't any public API for accessing the filesystem.
You can make your device to act as a HTTP server. There are several 3rd parties libraries that can help you get started. I personally have used iPhonrHTTPServer3 which is based on CocoaHTTPServer?

How can I make an SQLite database within an iPhone app available to the desktop?

My Android app stores its SQLite database on the SD card, so that when the phone is connected to a PC my desktop application can access it using an ODBC driver. Is a similar technique possible on the iPhone?
I know that iPhones do not have SD cards.
I use iTunes file sharing to access sqlite DBs on both the iPhone and iMac; iTunes moves the data. Enabled in the plist
As it has been said, it can't be done.
However what you could do is to embed a small Web Server into your App, and let the users to download the DB ( or even visualize it ), via WiFi on their homes/work. This approach would work for Windows/Mac/Linux users, and several apps are already doing it this way.
Good luck!
Not built-in, unfortunately. You'll have to roll your own Wi-Fi syncing system. You could use iCloud when it comes out in the fall, but that only works on Macs for now.
SQLite is present in the iPhone SDK, but there's no way to flag a file stored by your application as being visible to the file system when you plug your iPhone into the computer. As stated already by Chris Long, Apple's answer to this criticism is iCloud, which allows you to do synchronisation between arbitrarily many devices without cables, but that isn't available yet. The iOS 5 beta is available to registered developers and is publicly known to function with iCloud, so you could start developing now.
More painful temporary alternatives are to email the database out (there's a supplied way to do in-app email) or to expect your user to drag and drop the thing out of iTunes.

Can an iPhone OS app do a search of the device's filesystem?

Can I do a search of the iPhone filesystem from within an application? I need to search an iPhone OS device and return a list of all apps installed on an iPhone OS device. I am fairly aware of Apple's restrictions and rules concerning what apps can and mostly cannot do outside of the sandbox -- and know that aside from the Photo Album an Address Book (via specified classes) an application is not allowed to access much of anything outside of its home directory (sandbox) for security. But the boundaries are fuzzy.
Anyway, back to the question: Can UISearchBarDelegate (or any other class/protocol) allow me to search the iPhone device?
Unfortunatly you are still sandboxed, the only way to access the devices' filesystem is to create an application that is a jailbreak designed application.
Not strictly true - the app FileSystem, for example, allows you to browse the iOS file structure and view many (though not all) of the files. You can access almost all of the files from the iTunes backup however.

How to read iPhone files without jailbreaking?

I'd like to access files in an iPhone, such as using remotely connecting via ssh and telnet. But it appears that the iPhone's ssh or telnet are not supported. I can ping it, but cannot use telnet or ssh.
I read through some internet article, it appears that using jailbreak or Cydia it is doable, but I guess it would break my iPhone's license.
Is there an official way to ssh or telnet into my iPhone?
You can't just access any file in a non-jailbroken iPhone.
You can access data files for your own programs during development using Xcode's Organizer, go to Devices -> your iphone -> Summary -> Applications -> your app, click on the triangle thingy to show the Application Data, which you can download.
Otherwise use something like Airsharing (see moogs' answer which came as I was writing this) to upload&download a bunch of files.
I loved ssh-ing before, but Airsharing is even better. You can upload files via a wifi connection to your ipod (using a browser or via webDAV). It was free for the first few weeks, but now it goes for $4.99. That's still not bad.
You can view office, image, pdf and html files.
(I'm not affiliated with airsharing, just a happy user :) )
No you can't. You have to jailbreak to do that.
Even when not jailbroken, you can access some part of the filesystem with iPhone Broswer
I was very surprised and please with iPhone Explorer. It's one of those softwares that just work and needs nothing installed on the iPhone, but it will give full file access if your iphone is jailbroken.
Now, of course ideally we'd install something on the iPhone without needing anything on the computer and access files on the iPhone like a pen drive (and unlike some apps that do that but only through HTTP and wi-fi), but this is fairly good enough. And it's free! Because they use it to promote their other apps, and file exploring on iPhone is nearly useless for most users anyway.
There's just no way jose in hell to access all files in the iPhone without jailbreaking. Period. Apple have never allowed it.
Try using iFile I have tried all the others and this one is my favourites.
Hope this helps you.
You can do it with iFunbox, but you dont have access to edit, move , delete the system files , so you dont have full access to have full access you need to jailbreak your iDevice.