Environemnt
WDA(WebDriverAgent)
brew install carthage
git clone https://github.com/facebook/WebDriverAgent
cd WebDriverAgent && ./Scripts/bootstrap.sh
参考资料 WebDriverAgent详细配置中文版
先统一使用模拟器 iPhone 8做测试
能访问 http://127.0.0.1:8100/status 说明成功了。
Appium
依赖的一些软件
brew install --HEAD libimobiledevice
brew install ideviceinstaller
npm i -g ios-deploy
Appium Desktop提前安装好。命令行的appium也可以。
编译,打包 Appium Example App
UICatalog
git clone https://github.com/appium/ios-uicatalog
cd ios-uicatalog && open UICatalog.xcodeproj/
配置证书
编译.app
Product -> Build
查看打包的.app路径
BundleId: com.example.apple-samplecode.UICatalog.????
Mac查看本机IP的命令 ifconfig en0
Desired Capabilities
模拟器, platformVersion看情况 (instruments -s devices
查看所有能用的模拟器)
{
"platformName": "iOS",
"automationName": "XCUITest",
"deviceName": "iPhone 8",
"platformVersion": "11.4",
"app": "Path of UICatalog.app ~~"
}
真机, 需要先通过idevice_id -l
获取设备的udid, eg 84ad172e22d8372eb752f413280722cdcc200954
{
"platformName": "iOS",
"automationName": "XCUITest",
"usePrebuiltWDA": true,
"deviceName": "iPhone",
"udid": "84ad172e22d8372eb752f413280722cdcc200954",
"bundleId": "com.example.apple-samplecode.UICatalog"
}
Appium Inspector
其他资料
代理 export HTTP_PROXY=http://112.126.81.122:6$(date +%m%d)