Can I access filesystem of my iPhone using Xcode? - iphone

Is there any way to get access directly to the filesystem of iPhone connected to my Mac using Xcode?
Please keep in mind that the question is NOT about accessing filesystem from application (which is not possible outside of the application's sandbox) but about accessing it from Xcode.
The actual problem is with data on my iPhone which was somehow corrupted while developing several applications. The problem becomes even more stupid because of corrupted data being copied while doing backups and restoring system from it.
Maybe there are other ways to access device's filesystem without jailbreak?

Connect your iPhone and fire up Xcode. Open the Organizer and select your device, and then 'Applications'. You will now see a list of applications that should look familiar to you ;)
Select an app and click 'Download' at the bottom of Organizer.
If you wait long enough, you can even see the files down in 'Data files in sandbox'.

Related

Are there any tools for browsing iCloud data of your app?

I am working on integrating iCloud in my app and sometimes having problems with conflicts and save errors. The fact that the data is stored on the cloud makes it very hard to debug the problems.
As far as I know, the data on the iCloud servers are mirrored to a directory on the device. Is there any tool (an iOS or OSX app) that will allow me to see the contents of this directory or the files in the iCloud servers? I know that it is possible to query the files in the directory with NSMetadataQuery class. However, I am looking for a built-in tool from Apple or an open source application that I can use with my own entitlements.
So far I have tried the following tools with no luck:
On Mac OS X Lion, System Pereferences >> iCloud >> Manage: This only displays the name and size of the documents. It does not allow me to download or see the content.
On iOS 5, Settings >> iCloud >> Storage & Backup >> Manage Storage: Same as above.
On Xcode 4.3.2, Organizer >> Devices >> >> Applications >> Download: This allows me to download the application data but it does not contain the iCloud data.
I have also tried browsing the phone with iPhone Explorer application but it does not display the contents of /private/var which is where the iCloud data is stored.
...or visit http://developer.icloud.com to see what is actually stored in the cloud on Apple's servers...
I found the answer to my question in this answer.
It turns out the data on the cloud is automatically downloaded to my mac under "~/Library/Mobile Documents" folder if I enable "Document & Data" in iCloud Settings page and install a Mac app that is using iCloud.
Currently there is no documented way to view native iCloud data. However, depending on what your data is, you might be able to view it under some circumstances. For example, iCloud can be used to sync databases that are accessed via CoreData. If you store your data in a Sqlite database, which is then managed and accessed via CoreData, you can use 3rd party desktop apps to view the Sqlite file. I use this tool to view my Sqlite databases on a Mac: http://www.sqlabs.net/sqlitemanager.php

How do I remove data that was installed as part of an iPhone App I'm devleoping?

I'm developing an iPhone application that's particularly large, and contains loads of videos. (Not my fault, it's on behalf of a client).
I tried to run it on my iPhone, via XCode, not remembering I didn't have enough space on there to copy all the vids over, it errored halfway through.
However, it seems that the couple of videos it did manage to copy are still on the phone, and I now have 0 space on my phone, according to settings.
So I guess my question is where on the phones filesystem will these be stored, so that I can delete them?
EDIT: As the App didn't sucessfully install, theres no icon on the home screen for it.
Thanks
You can use iPhoneExplorer to explore/remove the files on your iPhone.
Have you tried the iPhone Configuration Utility? http://support.apple.com/kb/dl926
If the app has somehow been half-installed so it has no icon, then it might still appear in this tool where you can remove it.
If you can see the app on the organizer, try this:
1.- In the devices organizer, select Applications in the device.
2.- Select an application from the list of installed applications.
3.- Click Delete, and confirm that you want to remove the application.
Source: http://developer.apple.com/library/mac/documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/Devices/Devices.html
Figured it out, eventually found it in a folder called:
/private/var/mobile/Media/PublicStaging

Iphone app sharing file with iTunes problem

Somebody please help me out. This problem is killing me.
I went through tones of documents and posts. All seems to suggest that simply add a UIFileSharing key into info.plist and set boolean value to YES, files in App's Documents folder (not sub-folder, I know) will show up in iTunes.
However my problem is that I don't have an iPhone, so I really have no clue about what exactly the behaviors of both iPhone or iTunes will be when try to verify this file sharing thing. And what is the right way to verify this.
So when my client try to verify this off my watch (we are on different sides of earth), he keeps reporting back that file sharing feature not work. It is certain that file is properly stored under Documents folder.
In the last attempt, he claimed that he can see the app but not files.
I would like to know the following things, so I can guide him through this and end this pain:
Is it really plain and simple like add one key, no changes to code needed? Or did I miss something?
Are there any special requirements for building (like, only work for release build?), deploying?
What will really happen when plug the iPhone into the computer and sync with iTunes? Will the app show up in the Apps tab anyway, or only show up if file sharing feature are enabled correctly?
Thank you all.
Is it really plain and simple like add one key, no changes to code needed? Or did I miss something?
Yes
Are there any special requirements for building (like, only work for release build?), deploying?
No
What will really happen when plug the iPhone into the computer and sync with iTunes? Will the app show up in the Apps tab anyway, or only show up if file sharing feature are enabled correctly?
It will show up in the app view (on top) all the times. But you will only see them in the file sharing area if you have an app with enabled filesharing.
File sharing is only available on iPhone OS 4 onwards and iPad 3.2
Make sure your client has iOS4 or later.

How to retrive Core Data SQL store from Developer's App on the Developer's iPhone

I need a copy of the store that is saved as Core Data sqlite file inside a test app installed on my device.
I know how to get files out of the the simulator at path: ~/Library/Application Support/iPhone Simulator/[Version]/Applications/[AppID]/Documents
...but i need get the .sqlite file from the app on the device itself.
Unless the app itself has file sharing built in, you can't access the documents folder from outside the app. It is a security precaution and part of the sandbox.
Update:
I misunderstood the context of the question. To get files off a developers iPhone, connect the device and open Xcode>Window>Organizer. Select the device in the lefthand pane. In the righthand pane will be a list of applications. Your custom apps will have an arrow next to it. Hit the arrow and you will see "Application Data" hit the down arrow icon and it will let you download the data to folder. That folder will contain the apps Document, Library and tmp folders.
I wrote an application specifically for this to distribute to my customers and testers of my applications when they have problems. iPhoneRescue is free and allows you to get at all of the backup information in your iPhone; this includes any sqlite files.
All the users have to do is find their device backup, find the application, and then save the application files or just a specific file. (This does not work if they have encrypted their backups).

How to transfer Core Data store from provisioned iPhone to iPhone simulator?

I have a lot of data stored in my app on my provisioned device, and I want to do additional testing on my computer which is much faster than using the device. What is the best way to transfer the data store into the iPhone simulator so I can access it on the computer?
I think that you can download the data from your device in the Organizer in Xcode.
Once you unzip that folder you should be able to find your sqlite database file.
Now look for the folder on your hard drive where the simulator keeps its files. I think it's somewhere in ~/Library/Application Support/iPhone Simulator or something like that. There should be a folder for each app somewhere in there (the folder name will be some random ID), and you should be able to find an sqlite database with the same name. Replace that database with the one you downloaded from the device.
Sorry I can't give more detailed instructions. I'm at work currently and don't have access to my Macbook to get the exact folder names and such.