AppIntents don't show up in Shortcuts app when in SPM package

Hi there,

I successfully created an AppIntent for our app, and when I had it in the same target as our main app it showed up fine in the shortcuts app.

Then I realized that many of the new System Control widgets introduced in iOS 18 (e.g. lockscreen, control center) live in the widget extension target, but they also need to reference that same AppIntent. So to fix this, I thought I'd migrate out the code into it's own SPM package that both the WidgetExtension and the Main App processes can reference. However, after doing that and rebuilding, the intent no longer shows up in the Shortcuts app. Furthermore, my AppShortcutsProvider class now has this error when trying to define the list of appShortcuts:

App Intent <name> should be in the same target as AppShortcutsProvider

Is this intended, and if so, how do we reference the same AppIntent across multiple targets?

Answered by DTS Engineer in 797239022

When defining your types for App Intents in a different module, take care to make sure that you have a type conforming to AppIntentsPackage in both the module containing the types, as well as the module referring to those types. This is one of the most overlooked elements when setting this up.

Only framework types are supported for the module, and I suggest sticking to Xcode targets for that. Swift packages, in their default configuration, can link as either a static library or a dynamic library, depending on the surrounding build context to make an optimal choice, and that is our general recommendation for packages, but in this scenario for App Intents, means you might link as a static library, rather than as a dynamic library. Further, if you compare the build log for an Xcode framework target and for a Swift package target congigfued to be dynamic using Xcode 16 beta 4, you'll also notice that the Xcode framework target has a build step for extracting app intent metadata that the Swift package build does not. This intent metadata extraction step is important.

how do we reference the same AppIntent across multiple targets?

One thing you can do is include the source file in multiple targets, like a main app target and an app extension target.

— Ed Ford,  DTS Engineer

Figured it out. For anyone who was following the instructions at the end of the WWDC 2025 video on App Intents:

It appears AppIntentsPackage definitions are only required when you have an AppEntity conformances to define across package boundaries. AppIntents themselves are automatically discovered in any package or target, and defining AppIntentsPackage could result in duplicate metadata for AppIntents in the bundle, resulting in the OS being unable to resolve the AppIntent to use at runtime.

So if all you have is AppIntents to share across the app bundle and a widget extension for example, you do not need to define AppIntentsPackage at all. This is a Xcode 26 compiler feature and is retroactive to at least iOS 18.

AppIntents don't show up in Shortcuts app when in SPM package
 
 
Q