Skip to content

Non-macOS Devices

The Safari driver supports automating Safari on iOS and iPadOS, on both simulators and real devices.

In addition to the standard driver configuration, iOS/iPadOS tests have further requirements:

  • iOS/iPadOS must be at version 13 or later
  • The platformName capability must be set to iOS
  • If testing on simulators, Xcode and the iOS Simulator runtime must be installed
  • If testing on real devices, automation-related settings must be enabled on each device:

    Settings -> Apps -> Safari -> Advanced -> Turn Web Inspector ON

    Settings -> Apps -> Safari -> Advanced -> Turn Remote Automation ON

Unlike the XCUITest driver, the WebDriverAgentRunner application and all of its related configuration are not required.

Examples

A simple capability set for a new iOS/iPadOS session can then look as follows:

// This will launch Safari on the first connected real iOS device
{
  "platformName": "ios",
  "appium:automationName": "safari"
}

It is recommended to use Safari-specific capabilities such as safari:useSimulator, safari:deviceName, safari:deviceUDID and others to specify the exact test device:

// This will launch Safari on the simulator named 'iPhone 17'
{
  "platformName": "ios",
  "appium:automationName": "safari",
  "safari:useSimulator": true,
  "safari:deviceName": "iPhone 17"
}

Known Limitations

The safaridriver binary only automates web content, and cannot control any native iOS UI elements or simulator settings. As such, XCUITest-specific capabilities like appium:safariAllowPopups have no effect in the Safari driver.

To bypass native iOS system permission prompts (such as geolocation alerts) on iOS Simulators, use the appium:permissions capability. The capability is not supported on real devices. There, grant the permissions manually in the device settings beforehand (for example, in the Settings app under Privacy & Security and Apps -> Safari).

For other native alerts, you can use the XCUITest driver with browserName: 'Safari'.