Getting Started
System Requirements¶
There are three primary requirements to use the Mac2 driver:
- macOS host machine (version 11.3 Big Sur or later)
- Appium
- Xcode (version 13 or later)
Note
If you already have the driver installed, since version 1.9.0 you can also verify most of its requirements with the built-in Appium Doctor support:
Appium Server¶
Make sure to install a version of Appium that supports your target driver version. The requirements and prerequisites of Appium itself can be found in the Appium documentation.
| Mac2 driver version | Supported Appium server version |
|---|---|
| >= 3.0.0 | Appium 3 |
| 1.0.0 - 2.2.2 | Appium 2 |
Installation¶
Provided you have set up the above prerequisites, you can install the driver using Appium's extension CLI:
You can also specify an exact driver version:
Alternatively, if you are running a Node.js project, you can include appium-mac2-driver as
one of your project dependencies. Refer to the Appium documentation
for more information about this approach.
Verify the Installation¶
In order to check that the driver was installed correctly, simply launch the Appium server:
The server log output should include a line like the following:
Device Preparation¶
- Xcode must be configured to use its bundled Command Line Tools, in Xcode -> Settings -> Locations -> Command Line Tools
-
The Xcode Helper app (bundled with Xcode) must be granted Accessibility permissions:
-
Open Finder in the directory containing the Xcode Helper app:
-
Without closing Finder, open System Settings -> Privacy & Security -> Accessibility
- Drag and drop Xcode Helper from Finder to the Accessibility list in System Settings
-
-
Starting from macOS 12 Monterey, when starting a Mac2 driver session, macOS may occasionally show a system prompt in order to enable automation. The prompt can be disabled by running the following command:
Creating a Session¶
The Mac2 driver, like all Appium drivers, requires providing specific capabilities in order to start a new session. The following example lists the minimum required capabilities for a basic session:
// This will start a macOS session and attach to the Finder application
{
...
"platformName": "mac",
"appium:automationName": "mac2",
...
}
See the Capabilities reference page for more information on the capabilities supported by the driver.