Is it possible to see the contents of the Documents folder on iphone from the debugger console

I want to see the contents of the Documents folder from the console, I can see for the simulator, but it does not work for the device

my path is / var / mobile / Applications / 3E79C7B3-2639-477F-B355-1A3C70D4ECBE / Documents but how do I check this?

+3
source share
1 answer

You can find the location of the Documents directory like this:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
path = [paths objectAtIndex:0];

Then just print the contents of the directory to the console:

NSLog(@"%@", [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil]);

Here's the relevant documentation: http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/LowLevelFileMgmt/Articles/StandardDirectories.html

+5
source

Source: https://habr.com/ru/post/1759089/


All Articles