(iphone) access device's documents directory from mac?
Asked Answered
B

8

54

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

Barbiturate answered 31/3, 2011 at 5:0 Comment(1)
lifehacker.com/5914638/…Alpaca
U
50

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

Upton answered 23/8, 2011 at 8:52 Comment(2)
For the record, Viraj's answer does what you need. If you go into Organizer - Device - Applications and scroll down then hit download. Sorry, can't post an image being a new user.Maag
Actually this is the best answer.Pyo
D
59

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

enter image description here

Dianoetic answered 24/9, 2014 at 3:0 Comment(1)
It's called "Devices and Simulators" in newer Xcode versions. You can open it with Cmd+Shift+2Caro
U
50

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

Upton answered 23/8, 2011 at 8:52 Comment(2)
For the record, Viraj's answer does what you need. If you go into Organizer - Device - Applications and scroll down then hit download. Sorry, can't post an image being a new user.Maag
Actually this is the best answer.Pyo
A
22

I'm going to combine the two solutions together and add screenshots for clarity. This is with Xcode 7.

View/Download App Documents

  1. Open the Devices window through the menu Window -> Devices.
  2. Select your device.
  3. Select your application.
  4. Click the gear button for the options.

View/Download Documents

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.


  1. Select the Info.plist file in the Project navigator.
  2. Click the + button next to any property to add another.
  3. Scroll down the list or type to find Application supports iTunes file sharing.
  4. Change boolean value to YES.
  5. Re-build/install application.

Add file sharing support

Absorbance answered 12/8, 2015 at 23:48 Comment(1)
Had the same issue on xamarin.ios. After adding itunes permission, i can view the inner folders of my application on device.Rehabilitate
M
17

Hi Viraj's anwer is the way to go .Here is a screenshot: enter image description here

Maccarone answered 15/1, 2013 at 11:35 Comment(0)
S
11

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:

  1. Add the UIFileSharingEnabled key to your application’s Info.plist file and set the value of the key to YES.
  2. 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.

Suffumigate answered 31/3, 2011 at 5:27 Comment(2)
for whoever might need this, you need to delete your app from device and reinstall to make this work.Barbiturate
and this works for iOs 3.2 or greater.. wish there was some way to do this in lower iOS. i'm having weird crash (which i suspect sqlite misuse) only in 3.12Barbiturate
T
11

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

Like this

Theodosia answered 13/9, 2013 at 7:25 Comment(0)
W
3

With MacOS Catalina, Apple has made it very easy for reading the files written from the Documents directory.

Here are the steps:

  1. Once the device is connected to the Mac, it should be listed under the 'Locations' section in Finder as follows:

enter image description here

  1. 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.

enter image description here

You can drag and drop these files to any location in the Mac for further use

Wagonlit answered 10/7, 2020 at 6:45 Comment(0)
G
-1

One way can be to use iExplorer Download link iExplorer

Go to your app and Documents folder can be seen

Glasgo answered 24/9, 2017 at 21:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.