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

后端 未结 6 2047
遇见更好的自我
遇见更好的自我 2020-11-28 22:54

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 righ

相关标签:
6条回答
  • 2020-11-28 23:09

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

    Edit:

    You are right, give a try to iMazing

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-11-28 23:25

    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.

    0 讨论(0)
  • 2020-11-28 23:29

    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.

    0 讨论(0)
  • 2020-11-28 23:30

    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>
    
    0 讨论(0)
  • 2020-11-28 23:31

    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.

    0 讨论(0)
提交回复
热议问题