Access Desktop folder from appstore macOS application (sandboxed)

Hello,

I am writing a Desktop application for macOS with XCode.

This application will be available on app store. So, i have to put sandbox entitlement. So, this application won't be able to access Desktop folder. It will be jailed into a specific directory to store datas.

I have installed a macOS application from appstore. When I launched this application, I got a TCC prompt, asking me to allow this application to access Desktop (or Downloads I don't remember). How can this be possible ?

I have tried to write a sandboxed application which tries to access to Desktop folder. I didn't get any TCC prompt: My access was rejected.

How can I ask to access Desktop folder from I sandboxed application ?

Thanks a lot

Accepted Reply

You can specify the entitlement com.apple.security.files.downloads.read-write for access to Downloads, but there is no similar entitlement for Desktop.

Add a Comment

Replies

The correct way is to show an NSOpenPanel and ask the user to open the Desktop folder. Then store the security scoped bookmark.

  • I agree but you can try to install Parallels Desktop for macOS from appstore for example. You will see on first run a TCC prompt to access Download (or Desktop) folder. How can they do that ? There are no NSOpenPanel dialog

Add a Comment

You can specify the entitlement com.apple.security.files.downloads.read-write for access to Downloads, but there is no similar entitlement for Desktop.

Add a Comment