通常须要填写的参数有platformName(平台)、platformVersion(平台版本)、udid(设备的udid,填错不能启动应用)、deviceName(设备名称)、bundleid(应用的bundleid)、automationName(必须填写XCUITest,不写默认是UIAutomation的方式,该方式不支持IOS10)。
而后选中要启动的已经配置好的信息,点击Start Session。看到下面的画面表示启动成功,能够查看元素的accessibility_id、xpath、value等和坐标。支持录制脚本。
坑一、
A new session could not be created. Details: Appium's IosDriver does not support xcode version 8.3.3.
Apple has deprecated UIAutomation. Use the "XCUITest" automationName capability instead.
解决方案:
在--capability添加automationName=XCUITest参数
坑二、
AssertionError: Message: An unknown server-side error occurred while processing the command.
Original error: Unknown device or simulator UDID: '***'
解决方案:
Appium使用idevice_id(libimobiledevice的一部分)来肯定设备的可用性
brew install libimobiledevice --HEAD
坑三、
AssertionError: Message: An unknown server-side error occurred while processing the command. Original error:
Could not initialize ios-deploy make sure it is installed (npm install -g ios-deploy) and works on your system
解决方案:
安装ios-deploy
npm install -g ios-deploy
坑5:
appium-desktop 1.6.4及如下不支持xcode9.0.1,须要升级appium
坑6:
webdriverAgent安装失败
解决方案:
从新编译webdriverAgent,参考地址
cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=3825bba08e5c10c499ddaf0276bac01983ab7119' test