I am trying to build an App with File Provider finder extension (*.appex) with Xcode 12.5 (12E262) on macOS Big Sur 11.3.
The app and its plugin work well when I execute them with "Product -> Run" in Xcode. The sync folder create by File Provider locates at the Finder sidebar and users are able to manipulate files.
However, if I take the App built by Xcode and execute at somewhere else, the extension in App may not be started by fileproviderd as before.
Observations
I create two folders in my home folder, which are ~/fileprovider-1 and ~/.fileprovider-2.
The only different is that the second folder name starts with dot . and would not be seen in Finder (invisible).
-
Put my App in
~/fileprovider-1Everything works, File Provider extension is launched and files are enumerated in that sync location.
-
Put my App in
~/.fileprovider-2Nothing happened, only Main App is started. File Provider extension doesn't do anything.
After checking the log I found some deny error which doesn't print in the case 1:
- Main App:
/Users/allen/.fileprovider-2/Drive.app - Extension App:
/Users/allen/.fileprovider-2/Drive.app/Contents/PlugIns/DriveProvider.appex
- Main App:
2021-09-15 17:14:44.882366+0800 0x34ce3 Default 0x2b638 440 0 pkd: [com.apple.PlugInKit:ls] [u 5574EECF-XXXX-XXXX-XXXX-XXXXXXXXXXXXXXXX] [com.test.allen.Drive.DriveProvider(1.0)] plugin INSTALLED; bundleID: [com.test.allen.Drive.DriveProvider], path: [/Users/allen/.fileprovider-2/Drive.app/Contents/PlugIns/DriveProvider.appex], contained in [com.test.allen.Drive]
2021-09-15 17:14:44.909224+0800 0x344ca Error 0x2a9fe 541 0 fileproviderd: (FileProviderDaemon) [com.apple.FileProvider:default] [ERROR] Failed to create descriptor for extension <EXConcreteExtension: 0x7f8c98f2c620> {id = com.test.allen.Drive.DriveProvider}
2021-09-15 17:14:44.909173+0800 0x344ca Error 0x0 0 0 kernel: (Sandbox) Sandbox: fileproviderd(541) deny(1) file-read-data /Users/allen/.fileprovider-2/Drive.app/Contents/PlugIns/DriveProvider.appex
2021-09-15 17:14:44.910654+0800 0x344ca Default 0x2a9fe 541 0 fileproviderd: (FileProviderDaemon) [com.apple.FileProvider:default] [WARNING] no root reachable for provider <FPDProvider:0x7f8c9a063bc0 "com.test.allen.Drive.DriveProvider" uuid:"(null)">, skipping
Problem
I have no idea why folder name starts with . may make this difference.
Changing the entitlements in Main App / Extension App may not help, because the denied process is fileproviderd and it's not controlled by us.
Is there any method to avoid this problem? Any suggestions or comments are welcomed.
Best, Allen