59

there's a way to access a real device (iphone/ipad) document folder? I realized an app that store some data in that folder and i wanted to check if all is going in the right way.

Sasha Grievus
  • 2,266
  • 5
  • 26
  • 50
  • 4
    Sure: jailbreak, SSH. –  Mar 05 '13 at 08:59
  • are you talking about any app or the one you are developing? – tkanzakic Mar 05 '13 at 09:00
  • did you check [this](http://stackoverflow.com/questions/7377280/is-ios-developer-able-to-view-file-system) and [this](http://stackoverflow.com/questions/10201944/storing-and-reading-files-from-documents-directory-ios-5) – swiftBoy Mar 05 '13 at 09:14
  • Ok, i'll check what ssh is. I'm talking of an app i'm developing. I'll check the links. Thanks! – Sasha Grievus Mar 05 '13 at 09:17
  • 3
    if you look for a tool to read the files on the device the **[i-FunBox](http://www.i-funbox.com)** could be very useful for you. there is no need to jail-break the device. – holex Mar 05 '13 at 10:23
  • Installed! It's fantastic! Exactly what i was looking for. If you write the comment like an answer i accept it! Thank you very much! – Sasha Grievus Mar 05 '13 at 10:35
  • 1
    Follow the steps in the link: https://stackoverflow.com/a/62828698/6296219 for MacOS Catalina – Gurunath Sripad Jul 10 '20 at 06:49
  • @GurunathSripad This link helped to solve my issue. Now i can view application data files on device... – Vipin Krishna Jul 17 '20 at 08:22

6 Answers6

125

You can do this without iTunes and even if the file is somewhere else in the sandbox other than Documents.

Go to Window/Devices in Xcode.

enter image description here

Next, select your device, and find the app in the list.

enter image description here

Now, look at the little gear icon at the bottom of the devices window. Click that bad boy. enter image description here

See "Download Container..." in the list. Guess what that does? You got it. It downloads the whole sandbox with all the folders in the app's sandbox. Right click and "Show Package Contents".

This should let you see the sandbox of apps that have not yet been released. So, good for testing on a real device.

If you're testing on a simulator life is way easier. Just download the free app OpenSim here . Update: These days I prefer SimSim, also free here.

smileBot
  • 18,797
  • 7
  • 60
  • 62
79

To anyone looking out for the exact answer:-

1.Go to plist file of your project.

2.Add one row.

3.Then set the Boolean value of the property "Application supports iTunes file sharing" to "YES". (the key name is UIFileSharingEnabled)

And you are good to go.

Also note that you have to plugin the device in order to access the copied files (Programmatically). If you happen to go and try to access it on computer .. you wont be able to find the files.

Quark
  • 1,349
  • 2
  • 18
  • 30
Shailesh
  • 2,888
  • 3
  • 22
  • 31
  • 1
    I get access to document folder with iFunBox, it is quite simple. – Aleksey Timoshchenko Jan 22 '17 at 20:58
  • 18
    If you want to be able to access the files in the iOS Files app, make sure to also enable `LSSupportsOpeningDocumentsInPlace` (in addition to enabling `UIFileSharingEnabled`). – Nick Tiberi Aug 03 '18 at 19:12
  • 2
    Just wanted to mention for anyone trying to implement iOS file access for a Nativescript app, enabling both properties as Nick suggested work perfectly. – aethergy Sep 19 '18 at 06:02
  • 1
    Note that if you right click on the plist editor you'll see an option for "Show Raw Keys / Values", click that to see names like UIFileSharingEnabled instead of the longer / more verbose names – jrh Jun 25 '19 at 01:50
  • 1
    Also, with the two keys that @NickTiberi mentioned, I am able to see the (plain text) files my app wrote directly in the Files app on iOS, no need to connect to iTunes / download files / write a program to do it. But I can transfer it to my computer using iTunes as needed, see [this guide](https://support.apple.com/en-us/HT201301) – jrh Jun 25 '19 at 01:52
  • The Xcode plist editor label for `LSSupportsOpeningDocumentsInPlace` is `"Supports opening documents in place"` – Jon Willis Sep 02 '20 at 04:49
6

Your question is a bit unclear, but I can see three interpretations:

  1. You can plug your iPhone into iTunes to see your documents folder for any app with iTunesFileSharing enabled, including any apps you have written or are writing.

  2. If this is your own app, and you need help reading files from the documents folder, take a look at this question.

  3. If this is someone else's app, and you want to access the app's documents folder without iTunes and the app does not have implementation for what you want, then I am afraid some sort of jailbreaking and hacking is necessary.

Community
  • 1
  • 1
WolfLink
  • 3,200
  • 2
  • 25
  • 41
  • Sorry, six months of app developing and i keep feeling like a newbie! ^^' Yea, i have to access the document folder with my own developed app, but not programmatically. The app write some files into the document folder, and i want to see the content of the document folder with my own eyes, in order the check if the app is doing what is meant to do. Check filename, and so on. – Sasha Grievus Mar 05 '13 at 09:42
  • 1
    Then file sharing seems the way to go. This is a good tutorial: http://www.raywenderlich.com/1948/how-integrate-itunes-file-sharing-with-your-ios-app. You could also use the emulator since all folders are accessible through the file system. – Luis Mar 05 '13 at 10:53
  • Good to know, i didn't thought about the simulator. Could be useful to check the funcionatily of the app on the new iphone, which i don't own. For the file sharing issue, i've installed iFunBox, as suggested before. It's very cool. I'll check the itunes solution too. Thank you! – Sasha Grievus Mar 05 '13 at 11:06
  • It would have helped more had you mentioned the exact name of the property to set and where to set. – Shailesh Aug 14 '14 at 10:10
5

iExplorer can help in figuring out for an iOS app. :)

Edit:

You are right, give a try to iMazing

Reno Jones
  • 1,955
  • 1
  • 18
  • 28
  • Just found that it seems like it's not doing this kind of access any more. Was using iExplorer in the past but no luck with current version. – robbash Jun 24 '16 at 14:38
  • I just used iExplorer `v4.2.8` and it worked for me—complete access to app container on a TestFlight build installed on a physical device. – Evan R Mar 29 '19 at 16:47
1

You can access documents directory from code using:

+ (NSString *) applicationDocumentsDirectory {    
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
    return basePath;
}

And you can then go to terminal for the same path and check all the files.

e.g on my system its like this:

~/Library/Developer/CoreSimulator/Devices/<deviceID>
pkamb
  • 26,648
  • 20
  • 124
  • 157
KP_G
  • 442
  • 4
  • 15
1

If you are looking for a tool that import file from iOS app document folder to Mac, install Apple configurator 2 (https://apps.apple.com/us/app/apple-configurator-2/id1037126344?mt=12)

Connect your device to Mac and in Apple configurator follow below steps

Double click on the Device

Choose Actions > Export > Documents.

Select the file inside app to export, then click Choose. Save the items to the desired location in Mac.