Portrait

I2H3

Notes from work as an app developer for iPhones, iPads and Macs.

RSS Icon GitHub Mastodon

fileproviderctl Changes in macOS 14.4

Apparently, the feature set of fileproviderctl has been narrowed down to the dismay of developers, testers and even administrators and it appears to be intentional.

It has been discovered in the macOS 14.4 beta at the beginning of February already. The fact that this change made it into the final release may indicate its intention and that it is not a plain mistake. It would not have been the first time. Oh noes!

a memoji

macOS 14.3.1

On macOS 14.3.1, fileproviderctl -h still prints this:

$ fileproviderctl -h
File Provider control utility.
fileproviderctl <command> <options>

Commands:
  listproviders                                                  - Show registered providers
  thumbnail [<provider> <domain> <itemid>]|[<url>]               - dump thumbnail for an item
  attributes <item> [--direct]                                   - get attributes for a url [from fpd]
  dump [<domain|provider>]                                       - dump state of fileprovider's daemon
      --limit-dump-size                                                 limit the number of items dumped
  signal <provider> [<item id>]                                  - signal a provider on the given item (defaults to working set)
  materialize <item>                                             - materialize the path on disk
  evict <item>...                                                - make the paths on disk dataless
      -n,--namespace                                                    attempt to evict directories
  coordinate                                                     - perform a coordination on a given path
      -R, --recursive <path>                                            perform a recursive read
      -r, --read <path>                                                 perform a single item read
      -w, --write <path>                                                perform a coordinated write
      -d, --delete <path>                                               perform a coordinated delete
      -t, --time <seconds>                                              hold coordination for this long (default: inf)
      -e, --debug                                                       dump file coordination info
  stabilize [<domain>...]                                        - wait for the domain to stabilize
      -B, --barrier <item id>                                           apply a barrier on the specified item instead of a full stabilization
  evaluate <item>                                                - evaluate finder actions and decorations on item
  evaluate <action> [<item>] <target item>                       - evaluate finder interactions
  domain <action> [<domainid>]                                   - modify domains properties
  interactive-scheduling <domain>                                - interactive scheduling session
  check | repair                                                 - run FPCK
      -f                                                                perform a full dump (all items)
      -a <path>                                                         perform check under path
      -b <path>                                                         operate on an already created DB backup. If this is set you need to set -a to point to the domain root
      -o <path>                                                         write output into file at path
      -P                                                                no-pager output
      -d                                                                dimisss low-importance invariants
      -v                                                                print out files with broken invariants
      -m [<providerDomainID>]                                           perform check on the d2d migration backup
  obfuscate [<filename>/<path>...]                               - return the obfuscated form of the filename

fileproviderctl domain prints this:

$ fileproviderctl domain
Modify domains properties
Usage: fileproviderctl domain <verb> <options>, where <verb> is as follows:

    l|list
        List the domains

    disconnect <domainid>
        Disconnect (As the app can do) the domain indicated by <domainid>

    c|connect <domainid>
        Connect (As the app) the domain indicated by <domainid>

    remove [-PA] <domainid>
        Remove the domain indicated by <domainid>. A single wildcard is allowed at the end of domainid, which will cause all domains with that prefix to be removed. Bare wildcards are not allowed. -P will preserve user data, -A will archive user data. Default is to delete everything from disk.

    r|remove-app-ext <domainid>
        Make the app extension disappear as if the app was uninstalled

    a|add-app-ext <domainid>
        Make the app extension re-appear as if the app was re-installed

    resolve-error <domainid> [<error-code> [<error-domain> [<itemid>]]]
        Simulates the provider signaling that an error is resolved. If no error code is passed, all signalable errors will be signaled.

    import-progress <domainid>
        Fetch import progress report.

macOS 14.4.0

As visible in the output of the commands above, the functions are no longer available.

$ fileproviderctl -h
File Provider control utility.
fileproviderctl <command> <options>

Commands:
  dump [<domain|provider>]                                       - dump state of fileprovider's daemon
      --limit-dump-size                                                 limit the number of items dumped
  evaluate <item>                                                - evaluate finder actions and decorations on item
  evaluate <action> [<item>] <target item>                       - evaluate finder interactions
  check | repair                                                 - run FPCK
      -f                                                                perform a full dump (all items)
      -a <path>                                                         perform check under path
      -b <path>                                                         operate on an already created DB backup. If this is set you need to set -a to point to the domain root
      -o <path>                                                         write output into file at path
      -P                                                                no-pager output
      -d                                                                dimisss low-importance invariants
      -v                                                                print out files with broken invariants
      -m [<providerDomainID>]                                           perform check on the d2d migration backup
      -x xpc|daemon                                                     launch in XPC Service vs daemon (default)
  obfuscate [<filename>/<path>...]                               - return the obfuscated form of the filename

The fileproviderctl domain command is missing completely now.

Conclusion

It appears like not just us have to come up with a new solution to cleaning up an environment. There already are ideas floating around, including the inclusion of our cleanup tool in every app group which we build apps for to programmatically remove file provider domains.

a memoji

The thing is: apps themselves can remove the file provider domains programmatically by using NSFileProviderManager. Though, there are still leftovers in various places on macOS. iOS nicely cleans up after apps when they are removed from the system. Those leftovers here and there cannot be removed out of a sandbox. Also, shelling out to some command line utilities to reset granted app privileges only worked outside a sandbox for us. Hence we introduced an independent utility without sandboxing in the first place.

Well, at least have something which spares developers and testers from tedious procedures to clean up after a test or debug build. First removing the app, then navigating to the file provider domain in Finder and click the removal button is an annoyance, if you have to do that 50 times a day.