The Mac2Driver
Mac2Driver has been added to Appium since version 1.20. This driver is for automating macOS applications using Apple’s XCTest framework. It provides more flexibility and features in comparison to the legacy MacDriver and is better compatible with operating system internals. The driver operates in scope of W3C WebDriver protocol with several custom extensions to cover operating-system specific scenarios. The original idea and parts of the source code are borrowed from the Facebook’s WebDriverAgent project.
Mac2Driver从1.20版本就被添加到Appium中
此driver为MacOS自动化applications用于using Apple's XCTest framework.
它提供了更多的灵活性与MacDriver相比
与系统内部更好的兼容.
操作driver在W3C WebDriver协议范围内运行提供多个自定义扩展覆盖特定于操作系统的场景.
最初是想和部分源码从从Facebook's WebDriverAgent project借用
Development of the Mac2Driver happens at the appium-mac2-driver repo.
Mac2Driver在mac2-driver repo中进行开发
Requirements and Support
In addition to Appium’s general requirements:
- macOS 10.15 or later
macOS10.15以后的版本
- Xcode 12 or later should be installed
安装Xcode 12或更改版本
- Xcode Helper app should be enabled for Accessibility access. The app itself could be usually found at
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Agents/Xcode Helper.app
.
应启用Xcode Helper app进行访问
In order to enable Accessibility access for it simply open the parent folder in Finder: open /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Agents/
and drag & drop the Xcode Helper app to Security & Privacy -> Privacy -> Accessibility
list of your System Preferences
. This action must only be done once.
为启用对可访性访问,仅需在Finder中打开父文件夹
Usage
The way to start a session using the Mac2Driver is to include the automationName
capability in your new session request, with the value Mac2
. Of course, you must also include appropriate platformName
(only Mac
is supported). Read Mac2Driver documentation for more details.
使用Mac2Driver开始会话的方式是包含'automationName'
在新的会话请求中,
值为'Mac2'.
当然,你必须也包含'platformName'(仅是Mac支持的)
Capabilities
The list of available driver capabilities could be found in the driver README file.