I managed to get the File Provider extension working with some tricks with Xcode 12.2 RC (Version 12.2 beta 4 (12B5044c)) and macOS 11.0.1 RC (Version 11.0.1 Beta (20B5022a))
You cannot add a File Provider Extension target in Xcode (FB8889071). However it can be worked around by adding a different extension target then modifying the info.plist file accordingly. E.g. I added a Finder Sync Extension then modified the NSExtension part of the info.plist similar to an iOS File Provider Extension:
<key>NSExtension</key>
<dict>
<key>NSExtensionFileProviderDocumentGroup</key>
<string>group.com.yourappgroup</string>
<key>NSExtensionFileProviderSupportsEnumeration</key>
<true/>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.fileprovider-nonui</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).FileProvider</string>
</dict>
I’m not sure if all these keys are needed, but I guess the NSExtensionPointIdentifier and NSExtensionPrincipalClass must be set. The NSExtensionPrincipalClass value must be set to the class that implements the NSFileProviderReplicatedExtension protocol in your extension target.
Then in my app I do the following after launch to set up a file provider:
let domain = NSFileProviderDomain(identifier: NSFileProviderDomainIdentifier("com.myapp.fileprovider"), displayName: "MyAppFileProvider")
NSFileProviderManager.add(domain) { error in
		print("Add file provider domain: \(error as NSError?)")
		let manager = NSFileProviderManager(for: domain)
		manager?.signalEnumerator(for: .rootContainer, completionHandler: { error in
				print("Signal change error: \(error as NSError?)")
		})
}
This will add the file provider to the sidebar in Finder.
I got this so far, can enumerate items similar to iOS file provider.
The way the File Provider Extension should be set up, and how we should work with it is still lacking documentation and an example project.
Topic:
App & System Services
SubTopic:
Core OS
Tags: