How can I see the "documents & data?"

I made a very small 4gb web application game wrapped with Cordova. What's annoying me is that everytime I lose the game or even just launch the application after quitting it is that it increases in size by about 0.15mb. Under settings>general>storage>manage storage, I see that it's all "Documents & Data."


Is there any way to view what is in this folder? Because I'm not sure what's causing it; my best guess is that is either me pushing a score to an array in the web application's localStorage or the Cordova AdMob Pro plugin that I'm using because I prepare an interstitial ad after every time you lose in the game.

Accepted Reply

Is there any way to view what is in this folder?

Yes. To do this:

  1. in Xcode, choose Window > Devices

  2. select your device on the left

  3. select your app from the Installed Apps list

  4. use the gear menu to either browse your app’s container (Show Container) or download it to your Mac (Download Container) for offline analysis

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

Is there any way to view what is in this folder?

Yes. To do this:

  1. in Xcode, choose Window > Devices

  2. select your device on the left

  3. select your app from the Installed Apps list

  4. use the gear menu to either browse your app’s container (Show Container) or download it to your Mac (Download Container) for offline analysis

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks! Looks like all of the memory is being used by "fsCachedData" which according to some people on the internet is a bug in iOS 8 (I'm using iOS 9).


One thing to note is that you can't use a simulator to view the container. You have to have your app ran through Xcode onto your device.

One thing to note is that you can't use a simulator to view the container. You have to have your app ran through Xcode onto your device.

Right. If the problem reproduces on the simulator then investigating it is much easier:

  1. modify your app to log the paths to its containing at launch (code below)

  2. run the app and reproduce the problem

  3. go to the path you logged in step 1 using Terminal, Finder, or whatever

NSLog(@"%@", NSHomeDirectory());

The simulator uses the OS X file system directly, so data in your app’s container is directly accessible to OS X file browsers like the Finder. It’s just a question of knowing where to look (the paths can get rather complex and change over time).

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

After spending weeks of working on my app, I realized that the storage it was taking was 1.94 GB. The actual app size is 100 MB, while "Documents & Data" is taking up 1.93 GB.

The weird things is after I downloaded the container by going to Window -> Devices & Simulators -> Click on the app -> Download container, the container I downloaded is only 1.1 GB!

So how ios calculate the "Documents & Data" of an app ? Where are other 800MB locate at?

  • Did you ever figure this out? I'm at a similar situation.

Add a Comment