(iphone) access device's documents directory from mac? - iphone

I'm trying to access the documents directory at iphone device to see a log file that I saved while executing the app.
I know this can be done for simulator.
(you can browse the document directory of your app with Finder)
Can this be done for device?
Thank you

In Xcode 6 you should open Devices window to download it.

You can open Organizer in Xcode and download the documents directory when your device is connected right ?

I'm going to combine the two solutions together and add screenshots for clarity. This is with Xcode 7.
View/Download App Documents
Open the Devices window through the menu Window -> Devices.
Select your device.
Select your application.
Click the gear button for the options.
View/Download/Delete Documents through iTunes
IMPORTANT!!!
If you have documents within a subfolder, you will not be able to see or change them through iTunes.
Select the Info.plist file in the Project navigator.
Click the + button next to any property to add another.
Scroll down the list or type to find Application supports iTunes file sharing.
Change boolean value to YES.
Re-build/install application.

Hi Viraj's anwer is the way to go .Here is a screenshot:

iOS provides a framework to share documents between your application & iTunes. Check out the Core Services Layer section of the Apple docs, specifically the File-Sharing Support section. It explains how to do this:
Add the UIFileSharingEnabled key to your application’s Info.plist file and set the value of the key to YES.
Put whatever files you want to share in your application’s Documents directory.
On a side note, if this is just for debugging, you can always print logs using the default NSLog function and check the output using OS X's Console.

You also can use itunes for the same, but to view in itunes make change as below in your .plist
Add new key as "Application supports iTunes file sharing" and make it as boolen with value YES

With MacOS Catalina, Apple has made it very easy for reading the files written from the Documents directory.
Here are the steps:
Once the device is connected to the Mac, it should be listed under the 'Locations' section in Finder as follows:
Select the device. From the tab bar below the device details select 'Files'.
You will be able to see a list of apps that stored files to the Documents directory. Expanding each app will show the files with its document directory.
You can drag and drop these files to any location in the Mac for further use

One way can be to use iExplorer
Download link iExplorer

Related

Look inside Apps folder

is there a way to navigate inside the folder structure in iPad or iPhone, check what is inside of any app folder? I tried already xcode but can not identify the folders. Thanks...
You can't do it on a real device, but you can have a look on the simulator. Up until iOS 7 each iOS version maintains it's own set of apps under
Library/Application Support/iPhone Simulator/7.1/Applications/
followed by a cryptic number representing your app. Replace 7.1 with another iOS version. To display the Library folder in Finder, click Go from the Finder menu while holding down Option.
Since iOS 8 those locations have moved and are harder to find. See here: http://pinkstone.co.uk/where-is-the-documents-directory-for-the-ios-8-simulator/
Yes, you can use programs like "iExplorer" which let you navigate your device even without jailbroken devices. I often use it to check that my app is correctly creating files according to my coded file structure.
You can see only contents of Documents Directory on Simulator or device. If you want to see documents directory in device then you have to set UIFileSharingEnabled key to YES in your application's Info.plist file. Then you can see it via iTunes app in Mac os x.
There is not way to see bundle contents in application. Just you can see bundle contents in xcode.
Regards.

How to see the result of sqlite database file in firefox plugin when the app is run on iPhone device

I am using sqlite database in my app. When I run the application from simulator then I am able to see the result in firefox sqlite plugin in my .sqlite file. But when I run on real device then I am not able to see the result so can you tell me how can I see the result and from where I can get that sqlite file.
Short and Simple answer is "You Can't"
When you run on Simulator the generated applicationa nd Document files can be accessed in Library so you can easily check the sqlite file But
When you run on real device the sqlite file is in the document directory inside the device. and Apple does not allow to access the directory from device directly.
1)Enable Application supports iTunes file sharing when editing the info.plist file in Xcode
2)Connect your device to system then open iTunes then click device(such as iPad) then click apps in that you can see file sharing choose your app from that now you can see your sqlite file download that and open using firefox
If you are using Xcode version 6.1 the devices list has moved out of the Organizer. I was able to view the files for my app by:
Clicking Window->Devices and selecting my attached device on the left.
Highlight the application I wanted to view.
Click the settings gear icon below the list and select Download Container.
You are asked where you would like to save the container archive.
In Finder, left click the container archive and select view Show Package Contents.
Navigate to the file/folder you want to view.

how to locate the file which is saved in documents folder of the iphone

I am creating a file pdf in iphone application and it is saved in the documents it work fine on simultor i can also see the files.but how can i see this file when run the app on iphone device is there any way to get the file using itunes or any utility.
You can use Organizer.So example...
You can use itools.
1. Install itools
2. Connect your device with computer and open itools.
3. Go to "Apps" Tab, select your app.
4. Click on "document" icon,your app's document directory is opened.
5. Select the file and click "Export."
I know this is a late answer, but just in case it can help someone.
If you want to transfer a document from your ios app to computer, enable File Sharing in your app. Set the boolean flag “UIFileSharingEnabled” in your info.plist. Now when you connect the device and scroll to the bottom in the Apps page in itunes, there you can see all the files that are in your Documents folder in your app.

access iphone settings

I have saved an musicfile in the iphone path called-"/var/mobile/Applications/92B12BF1-88E1-4FD5-93DC-8311EC3B072A/Music" programmatically .Can I see those files in the iphone ?.Please tell me ,thanks in advance
Yes, you can set in your Info.plist the itunes file sharing property, which will make all files in your app's Documents directory visible to users, both to copy to the desktop and to save files from the desktop to the phone: "Application supports itunes file sharing" and check the box.
Not unless you jailbreak the phone. Other options are
1) store your file under <Application_Home>/Documents, then you can fetch the file from iTunes. You need to set UIFileSharingEnabled key in your Info.plist to YES.
2) run your program in your iOS simulator and examine the file.
92B12BF1-88E1-4FD5-93DC-8311EC3B072A is a GUID, which means it will change.
Second, the only way for you to "view" files outside of your applications sandbox is to be jailbroken.

iTunes Documents Directory in my app

how can I setup my app to accept documents via iTunes, like the Air Sharing or VLC app?
I mean, I want to allow users to get content from the app using iTunes.
Anyone know how?
Thanks
Copied from http://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniPhoneOS/Articles/iPhoneOS3_2.html#//apple_ref/doc/uid/TP40009337-SW11.
To enable file sharing for your application, do the following:
Add the UIFileSharingEnabled key to your application’s Info.plist file and set the value of the key to YES.
Put whatever files you want to share in your application’s Documents directory.
When the device is plugged into the user’s computer, iTunes displays a File Sharing section in the Apps tab of the selected device.
The user can add files to this directory or move files to the desktop.