General:
DevForums tags: Files and Storage, Finder Sync, File Provider, Disk Arbitration, APFS
File System Programming Guide
On File System Permissions DevForums post
File Provider framework
Finder Sync framework
App Extension Programming Guide > App Extension Types > Finder Sync
Disk Arbitration Programming Guide
Mass Storage Device Driver Programming Guide
Device File Access Guide for Storage Devices
Apple File System Guide
TN1150 HFS Plus Volume Format
Extended Attributes and Zip Archives
File system changes introduced in iOS 17 DevForums post
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Finder Sync
RSS for tagEnhance the Finder’s user interface by adding badges, shortcut menu items, and toolbar buttons using Finder Sync.
Posts under Finder Sync tag
20 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I am trying to move my home directory to a secondary drive, but I am running into to two issues.
When I try to do it via Finder I get the error - The operation can’t be completed because “<my account name>” needs to be downloaded. And when I try to do it via the terminal in recovery mode (after mounting the Data directory), It seems to copy a set of directories within ~/Library/Daemon Containers/. These appear to be snapshots of some sort, which when cp runs, end up taking up the entire drive of the target drive, which is 4 times larger than my base volume.
Two questions:
Why I am getting the message via finder (and how do I get around it?
What is the correct process for moving the home directory to a second drive?
Thanks!
Hi All,
I have a finder sync extension that passes data back to my main app. It currently writes to a plist file in my group container folder. Since updating to macOS 15, I have been getting this pop-up every time I trigger this writing to the plist after the finder sync extension loads.
This is how I write to the plist from my finder sync extension:
let appGroupDefaults = UserDefaults(suiteName: "group.team_id.Finder-Sync-Extension-Test-Project")
let items = FIFinderSyncController.default().selectedItemURLs()
DispatchQueue.main.async {
let url = items?.first?.absoluteString
var file = items?.first?.lastPathComponent
if let defaults = appGroupDefaults{
defaults.set(url, forKey: "targetURL")
defaults.synchronize()
}
self.showWindow(with: NSExtensionContext())
}
This is how I read the plist from my main app:
if let defaults = UserDefaults(suiteName: "group.team_id.Finder-Sync-Extension-Test-Project") {
defaults.synchronize()
if let clickedUrl = defaults.string(forKey: "targetURL") {
window = NSWindow(contentRect: NSScreen.main?.frame ?? .zero,
styleMask: [.miniaturizable, .closable, .resizable, .titled],
backing: .buffered,
defer: false)
window?.title = "My App"
window?.makeKeyAndOrderFront(nil)
textField.stringValue = clickedUrl
window?.contentView?.addSubview(textField)
}
}
It is fine if this popup happens once and the user's choice gets remembered. I just don't want it to happen every time.
Any help on if this is the correct way to pass data between the finder sync extension and the main app or on how to get macOS to remember the choice of the user would be great.
Thanks,
James
Hi all,
I am creating an app that, when you right-click on a file and select a custom option in the context menu, it pops open a window then processes this file.
Currently, I am writing that file name and path to a plist in my app's group container folder, sending a notification from my finder sync extension to my main app, and then reading the values in my plist.
Is this the best way to pass data between the finder sync extension and the main app? What is the industry standard way of doing this?
Thanks,
James
Not able to replicate this myself but have had a couple of users report this. I have a Finder Sync Extension. It does not, at least intentionally, change any sidebar icons. The hosting app mostly uses asset catalogs and the icon file it specifies in its info.plist is a icns file, not an iconset.
Any idea what may be causing this? Seems odd to me that there isn't some explicit setting to enable this instead of requiring some set of configurations lining up.
Hi all:
I am experimenting with Finder extensions. I’d like to be able to add a context menu to all folder locations. I believe the code below should work, but it doesn’t. If I hard code a path, it does work. Any tips on what I am missing?
Thanks!
// Doesn’t work
FIFinderSyncController.default().directoryURLs = nil
// Works for user folder
var myFolderURL = URL(fileURLWithPath: "/users/exampleuser")
FIFinderSyncController.default().directoryURLs = [self.myFolderURL]
Description
We used to use FIFinderSyncController.showExtensionManagementInterface() to navigate to the corresponding Setting's path via a button in our app to make the user enable our FinderSync App. (Or user can navigate manually via "System Settings -> Privacy & Security -> Extensions -> Added Extensions" themselves in Settings.app)
But the UI is now disappearing on macOS 15.0
As a result, if user had previously enabled it, user will now be unable to disable it, and if user had not previously enabled it, user will never be able to enable it.
STEPS TO REPRODUCE
Create an empty macOS app xcodeprojc, add Finder Sync Extension and run it.
Or you can use the repo here to reproduce the issue. https://github.com/Kyle-Ye/MenuHelper
Hello,
If a user allows access to, for example, Removable Volumes (TCC permission) to the main app, does these permissions will be inherited by a bundled Finder Extension from the main app?
More specific, I have an app that bundles a Finder Extension and both the main app and the bundled extension need access to Removable Volumes. Only the main app can request it, since the main app is the only that can prompt the user. If the user allows, will the bundled extension also receive the permissions?
If not, is there any workaround?
Regards.
Hello,
I developed a file provider extension that can access files from multiple locations. With the new macOS Sequoia I cannot access files from volumes, here is the error from Console:
Refusing TCCAccessRequest for service kTCCServiceSystemPolicyRemovableVolumes from extension Sub:{com.app.ext}Resp:{TCCDProcess: identifier=com.app.ext-Driver, pid=26706, auid=501, euid=501, binary_path.... Driver}, extension point disallows prompting
I added "Privacy - Removable Volumes Usage Description" values for both the main app and extension Info.plist, I click Allow on the alert, but still I receive this error message.
Any solution?
Thank you.
Hello!
I want to add an option to the finder context menu. In particular the context menu that shows when you right click empty space inside a folder.
Its not problem if I have to write some swift code.
It must be possible, because Google drive or Dropbox also add options to that menu directly.
I do not want to add a option to the Quick options, but just an option that right below the "New folder" option.
Is this possible? And can someone point me in the right direction? Maybe some API from apple or something?
Thanks!
'Remove Download' button in right click menu for iCloud folder in Finder on macOS does not work if total number of selected files/ folders at the time are more than 10 nos. If more than 10 non of files/ folders are selected at any time, then the 'Remove Download' button disappears from the right click context menu in macOS Finder for iCloud folders.
To click and act on the 'Remove Download' button on context menu of Finder upon right click, the total number of files and folders together must not exceed 10 nos.
Is this the behaviour expected, or am I missing something and this observed behaviour is a bug of Finder?
In the context of a NSFileProviderReplicatedExtension I would like to only see the "Move to Bin" Finder action when files have been materlialised ( isDownloaded fileprovider attribute )
I thought it might be possible to get the isDownloaded attribute in my NSFileProviderItemProtocol class capabilities method but that doesn't seem to be the case.
Possible ?
After downloading the latest beta of iOS 18 my iPhone no longer shows up in locations in finder on my Macbook. Instructions for when it doesn't show up also didn't help.
I'm writing a virtual file system as my educational project (generic kernel extension). Currently, mostly everything is implemented, however, I'm having trouble using Finder search and tags. The results simply don't show up - despite I am having vnop_... calls to those files.
The extended attributes are supported.
Inodes are stable.
Mmap is implemented. Vnop_ioctl returns KERN_SUCCESS (but no implementation).
An important moment: Previously, the search didn't work at all. Researching the web has shown me, that Spotlight indexation and Finder search are tightly glued. So basically I was trying to enable support for spotlight, thinking that would be the source of the problem. I was receiving "Unknown indexing state". All those tricks with mdutil, launchd, manual and reindexation either were doing nothing or returning error.
The problem was resolved FOR SONOMA by making by VFS appear as local one (adding flags for MNT_LOLCAL and MNT_DOVOLFS). This has changed the state from Unknown indexing state for spotlight to Indexing is disabled. No need to turn it on for me - I am interested only in search and tags, not the spotlight itself. Basically, whether spotlight recognises my driver as no-error, the Finder works correctly, even with indexation disabled.
Whether on Monterey*, or Ventura, I get the same problem. However, neither system logs nor my driver show any kinds of errors. The spotlight simply returns error. Reindexation attempt via Security&Privacy returns "Unknown error occured". The metadata for Ventura and Monterey read attempt (mdls) returns "Unable to locate file", however returns a huge list for Sonoma.
*Monterey and Ventura never have .Spotlight-V100 folder. No disable indexing files or other spotlight restrictions are present. No user space solutions seem to help.
The kext is unsigned and running in an environment with SIP disabled and Security Mode reduced to Permissive.
Maybe there some abstract rules for what is required on VFS side to be recognised okay'ish by Spotlight ? Or maybe something specific right for my case ?
Any pointers and/or assistance would be greatly appreciated.
On macOS Sequoia, the settings to enable FIFinderSync seem to have gone. I have already figured out that Extensions are no longer in the Privacy & Security section, but they are now at General › Login Items & Extensions. Here there is a Finder section, but that is just for the Finder-Extensions, not the Finder-Sync-Extensions. Those previously did not have their own section and were hidden away in the Added Extensions section that apparently no longer exists. I expect that it has been forgotten when migrating.
Where are the settings for this – have they been forgotten?
I'm unable to use third party Finder Sync Extensions on macOS 15, first beta. They do not appear in the Extensions section, that is now in System Settings - General - Login Items & Extensions.
I'm confuse about the loading condition of Finder Sync Extension.
I want to run the Finder sync as a user agent service, so I use a command line tool project and added a Finder sync extension target in the project.
But when I debug the extension in Xcode, select Finder to run, the init method of Finder sync class never called, I also check the Activity Monitor, there is no the Finder sync extension.
But if I use a Cocoa APP, the Finder sync extension will load as normal.
So what's the condition to run a Finder Sync Extension in Finder?
Hello,
I am developing a Finder plugin for a MacOS application. It was working fine during development and testing on os version 14.4. However, when I tried running the application on os version 10.15, it notworking.If I run the plugin binary directly, it will crash.
crash info:
Time Awake Since Boot: 1100 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [719]
Application Specific Information:
Configuration error: Couldn't retrieve XPCService dictionary from service bundle.
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libxpc.dylib 0x00007fff71b04bfb _xpc_copy_xpcservice_dictionary.cold.1 + 14
1 libxpc.dylib 0x00007fff71af2fcd _xpc_copy_xpcservice_dictionary + 106
2 libxpc.dylib 0x00007fff71af2e27 xpc_main + 61
3 com.apple.Foundation 0x00007fff3a0a5e6f -[NSXPCListener resume] + 155
4 com.apple.pluginkit.framework 0x00007fff6258decb 0x7fff62575000 + 102091
5 com.apple.pluginkit.framework 0x00007fff6258dbf4 0x7fff62575000 + 101364
6 com.apple.pluginkit.framework 0x00007fff6258e2b2 0x7fff62575000 + 103090
7 com.apple.Foundation 0x00007fff3a11eb4c NSExtensionMain + 49
8 libdyld.dylib 0x00007fff718a5cc9 start + 1
This issue just requires creating the simplest APP project + FinderSyncExtension project in Xcode 14.4 on macOS. Set the minimum supported system to 10.15 to reproduce the issue.
How can I resolve it?
I'm developing an APP on Mac. There will be some template sensitive file be decrypte during the user using it.
I don't want my client see these files by Finder or Terminal, so I tried to mount a file system and store the decrypted folder under the filessystem, then don't return the contents of decrypted folder when filesystem call contentsOfDirectory. It works under my filesystem.
But when user directly access these files by Finder(not from my filesystem mounted path), the files are still here can be seen by the user.
Is there anyway to make my files hide from Finder? Such as Finder extension, or some special folder Mac offered to store these sensitive files?
When setting up a Finder Sync Extension, even when just using the minimal template given by the File → New → Target → macOS ones provided in Xcode, the right-click menu does not show up within iCloud Drive, while toolbar buttons always work.
Outside iCloud Drive multiple extensions show up when right-clicking on Finder's background.
When right-clicking inside iCloud Drive (here my synced Desktop folder), they do not show up.
Before macOS Sonoma this worked perfectly for me, but it broke beginning with the first beta. No Finder extension from any app (such as the Keka one) work anymore. I have seen it discussed that not more than one Finder extension can be active in a directory, but that is not true as can be seen in the first screenshot.
Q: How can I circumvent this issue?