美文网首页
appium自动化测试,真机启动 (三)

appium自动化测试,真机启动 (三)

作者: HC2 | 来源:发表于2021-07-28 09:23 被阅读0次

一、环境准备:
1、安装appium
2、xcode
(appium 版本:12.1.0 + xcode版本:12.5 亲测可正常运行,ps:appium 版本:12.1.0 + xcode版本:13.0 一直报奇奇怪怪的错误)
3、依赖工具包安装
brew install --HEAD ideviceinstaller
brew install --HEAD libimobiledevice
brew install ios-deploy

4、WebDriverAgent: https://github.com/facebookarchive/WebDriverAgent
appium对真机的驱动需要:WebDriverAgent
WebDriverAgent:由Facebook 推出的一款iOS移动测试框架,也是appium跨平台的底层驱动;WDA本身也是一个完整的基于webdriver协议的框架

WebDriverAgent Runner 的处理:
appium已经自带WebDriverAgent,我appium版本是12.1.0
路径在 /path/where/installed/lib/node_modules/appium/node_modules/appium-webdriveragent

cd path/where/installed/lib/node_modules/appium/node_modules/appium- 
webdriveragent

mkdir -p Resources/WebDriverAgent.bundle

WebDriverAgent.xcodeproj在 Xcode 中打开。配置如下

image.png image.png image.png image.png

选择:


image.png image.png

build成功后

xcode选择链接你的真机后:

执行:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination "platform=iOS,name=iPhone" test

手机成功安装


image.png

appium 启动真机

{
"platformVersion": "14.5",
"platformName": "iOS",
"deviceName": "iPhone 12",
"bundleId": "********", //如果安装了包就用APP的bundleId,向开发人员询问
"app":"ipa路径"//使用路径,每次执行会重新安装
"xcodeOrgId": "xxxxxx",
"udid": "***********",//,
}

bundleId和app可二选一

其他appium版本webdriveragent的路径不一样,配置有点差别, 可查看官网
https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md

相关文章

网友评论

      本文标题:appium自动化测试,真机启动 (三)

      本文链接:https://www.haomeiwen.com/subject/qwnemltx.html