How do I create a daemon
Asked on 08/01/2024
1 search
To create a daemon on macOS, you can follow the steps outlined in the "Support semantic search with Core Spotlight" session from WWDC 2024. Here’s a summary of the process:
-
Create a New Target:
- Navigate to the file menu and select "New Target".
- Select the platform for the extension (e.g., macOS).
- Search for the new Core Spotlight delegate extension template.
- Click "Next" to configure this new target and "Finish" to add it to your project.
-
Activate the New Extension:
- Once added, activate the new extension.
- You can now look at the stub implementation.
-
Debugging:
- Set a breakpoint in the
reindexAll
method to catch this point in the code. - Make sure to call the acknowledgment handler to avoid blocking the caller.
- Rebuild your app to include this new app extension.
- Select the app's target, then head to the product menu and select "Build".
- Switch back to your extension target and from the debug menu, select "Attach to Process".
- Set a breakpoint in the
-
Using Command Line Utility for Debugging:
- Use the
mdutil
tool to simulate requests to your bundle ID for debugging. - Run the utility command in the terminal and then check your project in Xcode to see if you hit the breakpoint.
- Use the
For more detailed steps, you can refer to the session Support semantic search with Core Spotlight (05:13).
Relevant Sessions
- Support semantic search with Core Spotlight
- Explore the Swift on Server ecosystem
- What’s new in Swift
If you need more specific details or have other questions, feel free to ask!

A Swift Tour: Explore Swift’s features and design
Learn the essential features and design philosophy of the Swift programming language. We’ll explore how to model data, handle errors, use protocols, write concurrent code, and more while building up a Swift package that has a library, an HTTP server, and a command line client. Whether you’re just beginning your Swift journey or have been with us from the start, this talk will help you get the most out of the language.

What’s new in Swift
Join us for an update on Swift. We’ll briefly go through a history of Swift over the past decade, and show you how the community has grown through workgroups, expanded the package ecosystem, and increased platform support. We’ll introduce you to a new language mode that achieves data-race safety by default, and a language subset that lets you run Swift on highly constrained systems. We’ll also explore some language updates including noncopyable types, typed throws, and improved C++ interoperability.

Train your machine learning and AI models on Apple GPUs
Learn how to train your models on Apple Silicon with Metal for PyTorch, JAX and TensorFlow. Take advantage of new attention operations and quantization support for improved transformer model performance on your devices.