Xcode Swift 3.0 macOS (Sierra) app unable to create file, no permission

What worked for me in a similar case was to select Read/Write in "User Selected Files" in the Capabilities of the Sandbox.

enter image description here


I found the answer here so I thought I would help out. The issue is the limitations of sandbox. If you add

com.apple.security.temporary-exception.files.home-relative-path.read-write

To the entitlements file for the target as an Array with strings for the parent folders you want to watch. In my case I just added "/" to watch everything. Here's mine:

<key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key>
<array>
    <string>/</string>
</array>

This will allow you to access everything relative to the folder mentioned.

One warning: it seems (not thoroughly tested) that if there are other FIFinderSyncController's set up (in other apps), they can effect each other.