There's a way to access the document folder in iphone/ipad (real device, no simulator)?
IphoneIosIpadDocumentIphone 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.
Next, select your device, and find the app in the list.
Now, look at the little gear icon at the bottom of the devices window. Click that bad boy.
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:
-
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.
-
If this is your own app, and you need help reading files from the documents folder, take a look at this question.
-
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
-
If you have a physical device you can add the UIFileSharingEnabled key in info.plist and set its value to YES
-
then run your app
-
open iTunes select device and goto file sharing and select your app
-
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