通常須要填寫的參數有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