我有一个用 C 编写的可执行文件,它输出我在 Cocoa 应用程序中需要的一些信息。我的问题是我在项目中的哪里存储这个可执行文件?当我发布应用程序时,它的存储路径是什么?
我已阅读有关应用程序支持文件夹的信息。打印出来
print(FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first)
让我明白
Optional(file:///Users/cemal/Library/Containers/noorganization.ProjectName/Data/Library/Application%20Support/)
这是存储我的二进制文件的地方吗?如果是,我现在必须在构建时将其存储在哪里,以便将其存储在应用程序支持文件夹中?
最佳答案
您可能希望将额外的二进制文件存储在 .app
包中的 MacOS
目录中 - 将其存储在其他地方可能会产生问题,特别是如果它是一个位置可能无法访问。
.app/Contents/MacOS
Typically, this directory contains only one binary file with your application’s main entry point and statically linked code. However, you may put other standalone executables (such as command-line tools) in this directory as well.
关于swift - Xcode MacOS 存储所需二进制文件的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50634417/