Search code examples
iosconfigsandbox

iOS, config files and sandboxing


My understanding is that because of sandboxing, it isn't possible to view any text file (ie config file) associated with an iOS app using another app. Something quite simple with Android. Am I mistaken?

I am trying to implement a text config file with a Unity iOS app that gets loaded and parsed once when the application boots. This config file would also be able to be edited and saved manually on that actual iOS device.

(addendum) In Unity there is PersistentDataPath which resolves to /var/mobile/Container/Data/Application/foo/Documents

Is there an iOS supported file explorer app that will allow me view and edit files in this location (without jailbreaking)?


Solution

    1. Use can check iOS App Groups. It allows multiple apps access to shared containers and allow interprocess communication. There is no so much documentation about this, but maybe that's what you're looking for. At least you can share NSUserDefaults between the apps.

    2. NSUserDefaults it's a most simple way to save any (not big) configurations for your app. For manual editing: if your app on the device signed with developer certificate, you can connect through any iOS supported file explorer app and edit it. But after release, from App Store, your app installed in restricted/private path, so it's not possible, if only you don't have a jailbreak.

    3. Initial configuration you can put into your app bundle, and at the first run just copy them to NSUserDefaults.