jamesdd
V2EX  ›  Swift

macOS 沙盒中如何获得对任意目录的写权限?

  •  
  •   jamesdd · Mar 19, 2024 · 2250 views
    This topic created in 802 days ago, the information mentioned may be changed or developed.

    打算做一个 macOS app 来安装自己的一个插件到 Adobe 应用,在我的 app 中来把插件安装到 Adobe 应用的目录中。 1.如果 Adobe 应用是安装在默认目录 /Appliactions 中,不需要用户选择; 2.用户可以选择一个目录来进行插件的安装。 问题是在 sandbox 中是没有其他目录的写权限的,该如何申请写权限?目前探索到的方法是需要用户手动选择一个目录(用 NSOpenPanel),这只适合上面提到的第 2 种场景,但如果重启 app 后用户上次选择的路径也没有权限了。 请问有没有什么方法可以在 sandbox ( app 计划发布到 app store )中申请任意文件夹的写权限?还是说 macOS 上为了安全没有这个机制,只能用户选择具体路径? 不用具体代码,麻烦指个方向,该学习 apple 的哪方面的开发主题。 多谢!

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2808 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 07:27 · PVG 15:27 · LAX 00:27 · JFK 03:27
    ♥ Do have faith in what you're doing.