There's a way to access the document folder in iphone/ipad (real device, no simulator)?

IphoneIosIpadDocument

Iphone Problem Overview


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.

Iphone Solutions


Solution 1 - Iphone

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.

Solution 2 - Iphone

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.

Solution 3 - Iphone

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.

Solution 4 - Iphone

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

Edit:

You are right, give a try to [iMazing][2]

[1]: http://www.macroplant.com/iexplorer/ "iExplorer" [2]: https://imazing.com/

Solution 5 - Iphone

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>

Solution 6 - Iphone

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.

Solution 7 - Iphone

  1. If you have a physical device you can add the UIFileSharingEnabled key in info.plist and set its value to YES

  2. then run your app

  3. open iTunes select device and goto file sharing and select your app

  4. you will be shown files created by your app

Solution 8 - Iphone

Quick Solution

Just add this key in our plist and you're good to go

<key>UIFileSharingEnabled</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>

Visit this link for detailed explanation

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSasha GrievusView Question on Stackoverflow
Solution 1 - IphonesmileBotView Answer on Stackoverflow
Solution 2 - IphoneShaileshView Answer on Stackoverflow
Solution 3 - IphoneWolfLinkView Answer on Stackoverflow
Solution 4 - IphoneReno JonesView Answer on Stackoverflow
Solution 5 - IphoneKP_GView Answer on Stackoverflow
Solution 6 - IphoneMathew ChristyView Answer on Stackoverflow
Solution 7 - IphoneImran RasheedView Answer on Stackoverflow
Solution 8 - IphonetryKuldeepTanwarView Answer on Stackoverflow