Class

XCUIApplication

A proxy for an application that can be launched and terminated.

Topics

Creating an Application Proxy

init()

Creates a proxy for the application specified as the "Target Application" in Xcode's target settings.

Beta
init(bundleIdentifier: String)

Creates a proxy for an application associated with the specified bundle identifier.

Beta
init(url: URL)

Creates a proxy for the application at the specified file system URL.

Beta

Launching the Application

func launch()

Launches the application.

var launchArguments: [String]

The arguments that will be passed to the application on launch.

var launchEnvironment: [String : String]

The environment variables that will be passed to the application on launch.

Activating the Application

func activate()

Activates the application.

Beta

Terminating the Application

func terminate()

Terminates any running instance of the application.

Determining Application State

var state: XCUIApplication.State

The most recently observed state of the application.

Beta
enum XCUIApplication.State

The possible states an application can be in during UI testing.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software