Post not yet marked as solved
Post marked as unsolved with 1 replies, 1,359 views
I'm trying to associate a custom file type and extension with my Mac Catalyst app.
On the Mac, I can get this to work by adding the following key/values to my Info.plist:
keyCFBundleDocumentTypes/key
array
dict
keyCFBundleTypeName/key
stringCustomUTI/string
keyCFBundleTypeRole/key
stringEditor/string
keyLSHandlerRank/key
stringOwner/string
keyLSItemContentTypes/key
array
stringcom.jnpdx.customuti/string
/array
/dict
/array
keyUTExportedTypeDeclarations/key
array
dict
keyUTTypeConformsTo/key
array
stringpublic.data/string
/array
keyUTTypeDescription/key
stringCustomUTI/string
keyUTTypeIcons/key
dict/
keyUTTypeIdentifier/key
stringcom.jnpdx.customuti/string
keyUTTypeTagSpecification/key
dict
keypublic.filename-extension/key
array
stringcustomuti/string
/array
keypublic.mime-type/key
array
stringcustom/uti/string
/array
/dict
/dict
/array
Once I've modified the Info.plist, sometimes I have to build my app in Xcode and then drag the product to the Applications directory before launchd will associate the file type correctly.
Once I do this, my app appears in the "Open with..." menu.
However, the steps do not appear to work for a Catalyst target. If you look at the Twitter thread that I linked to before, it suggested that the Applications folder trick worked at one point, but I have had no luck getting it to work in Big Sur (I'm running 11.2.3).
I've created a sample repo (including a couple of sample files) that you can try this out with so a tester can avoid the process of creating the targets. There is nothing here except for a "Hello, world!" app with the Info.plist set up as described above, with a macOS native target and a Catalyst target. (Remember the hint about dragging to Applications): https://github.com/jnpdx/MacNativeUTITest