macOS授予对沙盒应用程序的全磁盘访问权限 [英] macOS Granting full-disk access to sandboxed app not working

查看:731
本文介绍了macOS授予对沙盒应用程序的全磁盘访问权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试全盘访问,但无法使其正常工作.这是我执行的步骤列表:

I'm experimenting with full-disk access and can't make it working. Here is list of steps I did:

  1. 沙箱已打开.实际上,权利文件如下所示:

<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.bookmarks.app-scope</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>

  1. 我创建了该应用程序的存档,并尝试同时使用 Developer ID Development 方法分发它
  2. 我将应用程序的二进制文件放入了/Applications 文件夹
  3. 我进入了系统偏好设置->安全和保护;隐私->隐私->完整磁盘访问权限,并在/Applications 文件夹中添加了对我的应用程序的访问权限
  4. 当然我没有使用 Xcode
  5. 附加到应用程序
  1. I created archive of the app and tried to distribute it using boths Developer ID or Development methods
  2. I placed the binary of my app to /Applications folder
  3. I went to System Preferences -> Security & Privacy -> Privacy -> Full Disk Access and added access to my app in /Applications folder
  4. Of course I'm NOT attached to the app with Xcode

我正在Xcode 11和Catalina上对其进行测试.它是虚拟应用程序,打开NSOpenPanel可以让用户选择要解压缩的档案,然后尝试在同一目录中将其解压缩.

I'm testing it in Xcode 11 and on Catalina. It's dummy app, opening NSOpenPanel to let user select archives to decompress and tries to decompress it in the same directory.

实际上与NSOpenPanel无关,问题是:

In fact it's not about NSOpenPanel, the question is:

使用全盘访问权限制作沙盒应用程序需要做什么?

有任何提示吗?我做错什么了吗?

Any hints? Am I doing anything wrong?

推荐答案

以下是解决方法找到了iTerm2 (值得一读的是如何找到解决方案).它只是将其添加到应用程序plist中:

Here is solution found for iTerm2 (it is worth read how solution was found). It just adds this to application plist:

<key>NSSystemAdministrationUsageDescription</key>
<string>I want to read all your files</string>

文档有点模糊.

可悲的是,此解决方案不适用于launchctld守护程序(这是我需要的).我认为守护程序是一个例外,因为根本看不到UI.

Sadly this solution doesn't work for launchctld daemons (this is what I need). I think daemons are an exception since the do not see UI at all.

但是对于常规应用程序,它应该像一种魅力(还没有测试).

But for regular applications it should work like a charm (didn't test it yet).

这篇关于macOS授予对沙盒应用程序的全磁盘访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆