AppIntentsTesting is a brand-new integration testing framework that lets developers write XCUITest-based tests to execute App Intents on-device โ covering intents, entity queries, and entity chaining โ without importing app code or using mocks.
โข Runs App Intents through the full production stack (no mocks, no stubs), catching real regressions that unit tests miss
โข Tests live in a standard XCUITest bundle, so CI pipelines pick them up automatically with zero extra configuration
โข Enables test-driven development for Siri, Shortcuts, and Spotlight integrations by asserting on entity results and intent return values
Demonstrates how to use AppIntentsTesting to create a calendar via an App Intent, assert on the returned entity's properties, and verify an entity string query โ all on-device without importing the app.
import XCTest
import AppIntentsTesting
final class CalendarIntentTests: XCTestCase {
// Bundle identifier of the host app under test
private let appBundleID = "com.example.CometCal"
private var intentDefs: IntentDefinitions!
private var entityDefs: EntityDefinitions!
override func setUp() async throws {
try await super.setUp()
intentDefs = try IntentDefinitions(bundleIdentifier: appBundleID)
entityDefs = try EntityDefinitions(bundleIdentifier: appBundleID)
// Seed deterministic test data using a test-only intent
let seedDef = intentDefs.intents["SeedSampleEventsIntent"]
let seedIntent = try seedDef.makeIntent(parameters: [:])
try await seedIntent.run()
}
// MARK: - Test: Create a calendar and assert return value
func testCreateCalendarReturnsCorrectTitle() async throws {
let createDef = intentDefs.intents["CreateCalendarIntent"]
let intent = try createDef.makeIntent(parameters: [
"name": "Occupy Saturn",
"color": "red" // AppEnum raw string value
])
let result = try await intent.run()
// Dynamic member lookup surfaces the entity's 'title' property
let title = try result.value.title as String
XCTAssertEqual(title, "Occupy Saturn")
}
// MARK: - Test: Entity string query returns matching events
func testEventStringQueryFiltersCorrectly() async throws {
let eventEntityDef = entityDefs.entities["EventEntity"]
// Executes EventEntity's EntityStringQuery on-device
let matches = try await eventEntityDef.entities(matching: "Cosmic Ray Calibration")
XCTAssertEqual(matches.count, 1)
let eventTitle = try matches[0].title as String
XCTAssertEqual(eventTitle, "Cosmic Ray Calibration")
}
// MARK: - Test: Chain two intents (create then update)
func testCreateThenUpdateEventTitle() async throws {
let createDef = intentDefs.intents["CreateEventIntent"]
let updateDef = intentDefs.intents["UpdateEventIntent"]
// Create the event; passing a String for a CalendarEntity parameter
// triggers the CalendarEntity's EntityStringQuery automatically.
let createIntent = try createDef.makeIntent(parameters: [
"title": "Asteroid Dodgeball Practice",
"date": "2026-09-01T14:00:00Z",
"duration": 3600,
"calendar": "Mission Control" // resolved via EntityStringQuery
])
let createResult = try await createIntent.run()
// Pass the returned EventEntity directly into the update intent
let updateIntent = try updateDef.makeIntent(parameters: [
"event": createResult.value,
"title": "Asteroid Dodgeball Rules Review"
])
let updateResult = try await updateIntent.run()
let updatedTitle = try updateResult.value.title as String
XCTAssertEqual(updatedTitle, "Asteroid Dodgeball Rules Review")
}
}
iOS 27 adds sectioned queries, codable model attributes, ResultsObserver for non-SwiftUI change observation, and HistoryObserver for reacting to persistent history changes in SwiftData.
USDKit is a new first-party Swift framework introduced in iOS/macOS 27 that brings native USD scene creation, composition, modification, and export capabilities to Apple platform apps, with deep RealityKit and Spatial Preview integration.
LiveCommunicationKit is the modern replacement for CXProvider that delivers rich, native conversation UIs integrated with the Lock Screen, Dynamic Island, Phone app Recents, and Siri. It provides a unified lifecycle model for audio and video conversations with a single delegate-driven action pipeline.
Test code never imports the app target โ all access is string-based via IntentDefinitions, so parameter names and types have no compile-time autocomplete. Custom parameter types require conformance to IntentValueConvertibleWrapper. The framework requires a UI Testing bundle (not a Unit Test bundle).
Requires the test runner and the app to use the same development team for code signing. Tests execute on-device only (not in the simulator without a matching provisioning setup).
The NowPlaying framework introduces a first-class Swift API for surfacing app media in system-wide now-playing surfaces โ Lock Screen, Control Center, Dynamic Island, StandBy, CarPlay, Apple Watch, and Apple TV โ via a declarative MediaSessionRepresentable protocol. It also supports remote media sessions (for controlling external speakers/TVs) and Media Sharing Extensions for routing media to third-party devices.