TechnologiesDeveloper Tools & Diagnostics

XCUIAutomation

iOSmacOStvOSwatchOSvisionOS

XCUIAutomation provides the UI automation API that drives UI testing, exposing accessibility elements, queries, and interactions across iOS, macOS, tvOS, watchOS, and visionOS. You synthesize input using types such as XCUIKeyboardKey, XCUIGestureVelocity, and XCUIRemoteButton, and you gate access to system data with XCUIProtectedResource. The framework also surfaces accessibility audits through XCUIAccessibilityAuditType and XCUIAccessibilityAuditIssue, letting you inspect and report problems found in your interface.

Accessibility Audits 2

Run automated accessibility checks and inspect the issues they report.

  • St
    XCUIAccessibilityAuditTypeiOS 17.0+
    Bitmasks for use with [XCUIApplication performAccessibilityAuditWithAuditTypes:issueHandler:error:].
  • Cl
    XCUIAccessibilityAuditIssueiOS 17.0+
    Represents an issue returned by an accessibility audit.

Synthesizing Input 3

Drive keyboard, gesture, and remote-control input during UI tests.

  • St
    XCUIKeyboardKey
    Constants for use with -[XCUIElement typeKey:modifierFlags:],
  • St
    XCUIGestureVelocity
    A type that specifies the speed at which a synthesized gesture is performed.
  • En
    XCUIRemoteButton
    @enum XCUIRemoteButton

System Resource Access 1

Identify the protected system resources a test may request access to.

  • En
    XCUIProtectedResourceiOS 13.4+
    Constants that identify protected system resources a UI test can request access to.

Classes 11

  • Cl
    XCUIElement
    @class XCUIElement (/seealso XCUIElementAttributes)
  • Cl
    XCUIApplication
    Proxy for an application that may or may not be running.
  • Cl
    XCUICoordinate
    A coordinate represents a location on screen, relative to some element. Coordinates are dynamic, just like the elements to which they refer, and may compute different screen locations at different tim
  • Cl
    XCUISiriServiceiOS 10.3+
    @class XCUISiriService
  • Cl
    XCUILocation
    @class XCUILocation
  • Cl
    XCUIDevice
    Represents a device, providing an interface for simulating events involving physical buttons and device state.
  • Cl
    XCUIElementQuery
    Object for locating elements that can be chained with other queries.
  • Cl
    XCUIScreen
    Represents an active screen of a device. One screen of each device is designated
  • Cl
    XCUIScreenshot
    Represents a captured screenshot.
  • Cl
    XCUIVoiceOverServiceiOS 27.0+
    @class XCUIVoiceOverService
  • Cl
    XCUISystem
    @class XCUISystem

Protocols 5

  • Pr
    XCUIElementAttributes
    Protocol describing the attributes exposed on user interface elements and available during query matching. These attributes represent data exposed to the Accessibility system.
  • Pr
    XCUIElementTypeQueryProvider
  • Pr
    XCUIScreenshotProviding
  • Pr
    XCUIElementSnapshot
  • Pr
    XCUIElementSnapshotProviding
← Developer Tools & Diagnostics