How do I include a macOS (AppKit) app extension in a Mac Catalyst app?

Asked on 07/30/2024

1 search

To include a macOS (AppKit) app extension in a Mac Catalyst app, you can follow these general steps:

  1. Create a New Target for the Extension:

    • Navigate to the file menu in Xcode and select "New Target".
    • Choose the platform for the extension, in this case, macOS.
    • Search for the appropriate extension template, such as a Core Spotlight delegate extension.
    • Configure the new target and add it to your project.
  2. Activate and Implement the Extension:

    • Activate the new extension and implement the necessary functionality.
    • For example, if you are creating a Core Spotlight delegate extension, you would implement the delegate methods to handle indexing requests.
  3. Build and Debug the Extension:

    • Select the app's target and build the app to include the new extension.
    • Switch to the extension target and attach to the process for debugging.
    • Use tools like mdutil to simulate requests and test the extension.

For a detailed demonstration on creating an index delegate extension, you can refer to the Support semantic search with Core Spotlight session.

Relevant Sessions

If you need more specific guidance or have additional questions, feel free to ask!