47

What is the equivalent of Window's C:\Users\userName\AppData\Roaming\appName?

I need a directory that won't cause permission problems to store the updateable part of my application so I can automatically download and override my content.

Thank you.

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
kambi
  • 3,291
  • 10
  • 37
  • 58

2 Answers2

60
/Users/USERNAME/Library/Application Support/

Edit:

This answer has drawn a lot of upvotes despite its minimalistic nature. Therefore, I want to point out the things mentioned in the comments here to make them more visible:

  • There are several other folders being used for application data / configuration, as mentioned in this answer.
  • If writing an application, don't hardcode that path. Instead, use macOS' API to retrieve it. This question has several answers for both ObjectiveC and Swift.
flyx
  • 35,506
  • 7
  • 89
  • 126
  • 4
    One shouldn't actually hard-code that path, since it is possible to move one's home directory. Use `-[NSFileManager URLsForDirectory: NSApplicationSupportDirectory inDomains: NSUserDomainMask].` – JWWalker Mar 30 '15 at 16:42
  • 3
    **This may not be the correct answer**. See https://apple.stackexchange.com/a/28930/6533 – Pacerier Oct 06 '17 at 05:57
  • 1
    On my Mac `System.Environment.SpecialFolder.ApplicationData` (C#) returns `/Users/USERNAME/.config`, which (probably as a result) is also a folder that is used by some applications. – Joost Huizinga Jan 31 '18 at 05:38
  • @JoostHuizinga Yes, that directory conforms to the [XDG Directory Specification](https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html). This schema is primarily used by applications that have been ported from Linux; however, it is not considered by macOS to be a config directory. Note that this directory is sometimes also used on Windows by ported applications; so it is certainly not equivalent to Windows' *native* application data directory. – flyx Jan 31 '18 at 10:07
  • Is there an environment variable for that? – Royi May 31 '19 at 15:47
  • @Royi Not directly, but you can use `"$HOME/Library/Application Support"` in a script. – flyx Jun 01 '19 at 21:36
19
~/Library/Application Support/ 

in shift+command+G in finder

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
TEH
  • 191
  • 1
  • 2