On a Mac, there are several different locations that an app can store its data, as described here:
Our app creates its own database, and manages files that users create via it (i.e. users don’t choose where to save their files). That makes it sound like a good match for the Application Support folder, which is described as follows:
[quote]Use this directory to store all app data files except those associated with the users documents. For example, you might use this directory to store app-created data files, configuration files, templates, or other fixed or modifiable resources that are managed by the app. An app might use this directory to store a modifiable copy of resources contained initially in the apps bundle. A game might use this directory to store new levels purchased by the user and downloaded from a server.
All content in this directory should be placed in a custom subdirectory whose name is that of your apps bundle identifier or your company.
In iOS, the contents of this directory are backed up by iTunes and iCloud.[/quote]
That mostly worked well for us, with two exceptions:
-
The fact that the ~/Library/ is hidden causes non-technical users problems when dealing with things like disaster recovery.
-
Some “clean your Mac” style apps seem to think that anything in ~/Library/Application Support/ is fair game, and have then created just that kind of disaster recovery scenario [extreme headdesk]
Because of those problems, we recently moved our app’s data folder to ~/Documents/ This has been going very well for us, and completely eliminated both of those customer support headaches. Until
Along comes macOS Sierra, and the new iCloud Desktop & Documents sync feature. That’s going to create all kinds of interesting interactions with our own data storage and synchronisation system. We also have what I think is a relatively recent addition to Apple’s documentation:
That’s nice and clear, but I’m dreading moving our app’s data folder back to ~/Library/Application Support/ because of the support headaches that it’s created in the past. I suppose we could move it to ~/Library/ourAppName/ to try and avoid problems with “clean your Mac” apps deleting things from ~/Library/Application Support/ but we still have the problem of non-technical users sometimes needing to interact with the hidden ~/Library/ directory.
So
Does anyone else have any opinions on the most sensible location for apps to store their data?
Does anyone else who’s using ~/Library/Application Support/ have any bright ideas for coping with apps that seem to think that folder is something that they can mess around with?