iosxcode

Is there a way in Xcode to browse the contents of the iOS app's NSDocumentDirectory?


For debugging I have saved out a number of files in the standard system directory 'Document', i.e. the NSDocumentDirectory, the one returned by this call

let documentDirectoryURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!

If I set a breakpoint in my app is there a way in Xcode on the Mac of browsing and examining those files from the iPhone my app is being debugged on?


Solution

  • You can download the Container of app in your mac and see the files that are there

    In Xcode , select the device, select the app name under Installed Apps, click the settings gearbox, then select Download container. In finder, double finger tap the package and select Show package contents.

    see example: go to Window -> Devices