Search code examples
iphoneiosunit-testinggh-unitnsdocumentdirectory

Is it even possible for one iOS app to access another app's Caches directory?


I'm writing a unit test with GHUnit. I would like to check if a file is being generated in the Caches directory within the Library directory of another app. Is this feasible, or are apps prevented from accessing each others' Library directories? And if so, are there any possible workarounds for creating a unit test for this? Could I possibly store the generated file in a different directory, such as Documents, or would that not help?


Solution

  • I don't understand the context that you're attempting to unit test, so maybe my answer is wrong, but what I get is that you want to access your other app because GHUnit builds as a separate app.

    There should be no reason to do this - instead of beating the sandbox problem, let's go around the whole issue.

    Why not run whatever cache-creating code you are trying to test in the first place from the test target app, and then check the Libary/Cache directory of your bundle?

    That's all there should be to it.