macos Mac 中应用程序的数据文件夹

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9495503/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 08:55:30  来源:igfitidea点击:

Application's data folder in Mac

macosupdatesspecial-folders

提问by kambi

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

Window 的等价物是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.

谢谢你。

回答by flyx

/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 questionhas several answers for both ObjectiveC and Swift.
  • 本答案所述,还有其他几个文件夹用于应用程序数据/配置。
  • 如果编写应用程序,请不要对该路径进行硬编码。相反,使用 macOS 的 API 来检索它。这个问题对 ObjectiveC 和 Swift 都有几个答案。

回答by TEH

~/Library/Application Support/ 

in shift+command+G in finder

取景器中的 shift+command+G