TechnologiesDeveloper Tools & Diagnostics

AppIntentsTesting

iOSmacOStvOSwatchOSvisionOS

AppIntentsTesting provides a test harness for exercising App Intents, entities, and queries in unit tests without relying on the live system. You describe the intents under test with definitions such as AppIntentDefinition, AppEntityDefinition, and AppEnumDefinition, gathered through IntentDefinitions and the AppIntentTypeDefinition protocol, then drive queries using types like AnyEntityQuery, IntentValueQueryDefinition, and ResolvedValueQueryResult. Supporting types including AnyAppEnum, TransientAppEntityDefinition, DynamicPropertyPathCollection, and ViewAnnotation let you stand in for system-resolved values and inspect intent behavior across iOS, macOS, tvOS, watchOS, and visionOS.

Essentials 2

The protocol and registry that gather the intent types you want to exercise in tests.

  • Pr
    AppIntentTypeDefinitioniOS 27.0+
    A protocol that associates a definition type with its corresponding instance type.
  • St
    IntentDefinitionsiOS 27.0+
    A collection of definitions that catalog your app's intents, enums, entities, and queries.

Intent and Entity Definitions 4

Definitions that describe the intents, entities, and enumerations under test in place of the live system.

  • St
    AppIntentDefinitioniOS 27.0+
    A definition you use to dynamically create intent instances for testing.
  • St
    AppEntityDefinitioniOS 27.0+
    A definition you use to dynamically create entity instances for testing.
  • St
    AppEnumDefinitioniOS 27.0+
    An app enumeration definition for testing and dynamic enumeration creation.
  • St
    TransientAppEntityDefinitioniOS 27.0+
    A definition you use to dynamically create transient app entities for testing.

Queries and Results 3

Types for driving entity and value queries and inspecting the values they resolve.

  • St
    AnyEntityQueryiOS 27.0+
    A type-erased, intermediate representation of your entity query for testing purposes.
  • St
    IntentValueQueryDefinitioniOS 27.0+
    A definition you use to create an intent value query for testing.
  • St
    ResolvedValueQueryResultiOS 27.0+
    The result of an intent value query.

Supporting Values and Inspection 3

Helpers that stand in for system-resolved values and let you inspect intent behavior.

  • St
    AnyAppEnumiOS 27.0+
    A type-erased representation of an app enumeration that provides dynamic enumeration value access.
  • St
    DynamicPropertyPathCollectioniOS 27.0+
    Indexed result items from an intent value query.
  • St
    ViewAnnotationiOS 27.0+
    The onscreen context you provide to the system by annotating a view with an app entity.

Structures 6

  • St
    AnyAppEntityiOS 27.0+
    A type-erased, intermediate representation of your app entity for testing purposes.
  • St
    AnyAppIntentiOS 27.0+
    A type-erased, intermediate representation of an app intent for testing purposes.
  • St
    AnyTransientAppEntityiOS 27.0+
    A type-erased representation of a transient app entity that provides dynamic property access.
  • St
    DynamicPropertyPathiOS 27.0+
    A type-safe, dynamic path to access nested intent values.
  • St
    IntentValuePropertiesCallableiOS 27.0+
    A callable wrapper that creates app intent instances from keyword arguments.
  • St
    ResolvedIntentResultiOS 27.0+
    A type-safe result from performing an app intent.
← Developer Tools & Diagnostics