Mac os x的包管理工具,安装方法:终端输入:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
检验安装:brew -v
app store中下载安装
终端:brew install node 安装
检查安装:node –v
npm install wd
检验安装npm wd -v
传送门:http://appium.io/downloads.html
可单独配置Android_home和java_home
关于iOS session的具体参数配置,参照https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md
启动成功如截图所示:
使用xcode打开appium目录下的WDA中的WebDriverAgent.xcodeproj
/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
如 启动真机iPhone7 iOS 11.4.1中的支付宝app设置如下:
{
"platformName": "iOS",
"platformVersion": "11.4.1",
"deviceName": "iPhone 7",
"automationName": "XCUITest",
"app": "com.alipay.iphoneclient",
"udid": "pls relaced with ur device's udid",
"noReset": true
}
可能遇到的问题:
1.Unable to launch WebDriverAgent because of xcodebuild failure: "Carthage binary is not found. Install using `brew install carthage` if it is not installed and make sure the root folder, where carthage binary is installed, is present in PATH environment variable
解决办法:brew install carthag
2.[XCUITest] The 'idevice_id' program is not installed. If you are running a real device test it is necessary. Install with 'brew install libimobiledevice --HEAD'
解决办法:brew install libimobiledevice --HEAD
3.[XCUITest] Error: Could not initialize ios-deploy make sure it is installed (npm install -g ios-deploy) and works on your system.
解决办法:npm install -g ios-deplo
4.Unable to launch WebDriverAgent because of xcodebuild failure: "xcodebuild failed with code 65". Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device
解决办法:https://testerhome.com/topics/8533
注:如果还是报此错误,请先在通用>>设备管理>>开发者应用 中信任当前证书
参考:
1.Appium自动化—浅谈iOS自动化测试环境搭建
https://www.jianshu.com/p/c43a94ecca97
2.iOS真机调试
https://jingyan.baidu.com/article/358570f6b3f4f4ce4724fc0a.html
3.Setting up iOS Real Devices Tests with XCUITest
https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md