How can I view the contents of the Application group container directory when debugging an iOS application?

Pretty explanatory.

We can view application documents, libraries, tmp directories through Window> Devices (this was forever).

But when the app extensions appeared on the scene with iOS8, they joined the common App Group app container. How can I view its contents?

Edit: to clarify, I am not asking how to interact with this directory in code. I am asking how to interact with this directory in the context of the Finder.

+5
source share
1 answer

Get the path to the application group

#define APP_GROUP_PATH [[[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:@"yourGrpupId"] path] 

The following code to view shared container data

 NSLog(@"Shared container data:%@",[self listFileAtPath:APP_GROUP_PATH]); -(NSArray *)listFileAtPath:(NSString *)path { int count; NSArray *directoryContent = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:NULL]; for (count = 0; count < (int)[directoryContent count]; count++) { NSLog(@"File %d: %@", (count + 1), [directoryContent objectAtIndex:count]); } return directoryContent; } 
0
source

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


All Articles