Wednesday, 13 February 2019

iOS10 filesystem - are files no longer in app container?

For debugging purposes I've often written data to files on iOS using code such as this...

NSString *docsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSString *filePath = [docsPath stringByAppendingPathComponent:testName];
FILE* resultsFile = fopen([filePath UTF8String],"w");

...and then gotten the data by downloading the container via Xcode (by selecting the app on the "Window->Devices" screen, and choosing "Download container..." from the "little gear" pop-up menu just below the list of apps.)

I recall this working on iOS 9 and previous, but trying this on iOS 10 on an iPhone 6, I'm finding it doesn't work anymore. The call to fopen is returning success for /var/mobile/Containers/Data/Application/[uuid]/Documents/testname but the file isn't in the container when I download it.

Shouldn't the file be in the container? Is it elsewhere? Or is it simply not possible to dump data to a file and pull it off the phone anymore?



from iOS10 filesystem - are files no longer in app container?

No comments:

Post a Comment