欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 教育 > 锐评 > MAC系统下Xcode连接iOS真机实现iOS App自动化测试(上)

MAC系统下Xcode连接iOS真机实现iOS App自动化测试(上)

2024/10/24 22:24:15 来源:https://blog.csdn.net/chengsj5/article/details/132316048  浏览:    关键词:MAC系统下Xcode连接iOS真机实现iOS App自动化测试(上)

安装Xcode, 需选择与你MAC系统兼容的Xcode版本

Xcode download: Sign In - Apple

安装appium inspector ​编辑Release 2023.6.2 · appium/appium-inspector

安装java并进行相关环境变量的配置, 可以在官网下载稳定版本, 没有过多要求

安装homerew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

安装nodejs(​编辑Download | Node.js )

安装appium server

npm install -g appium@next

安装xcuitest-driver(xcuitest也是基于webdriveragent)

appium driver install xcuitest

安装appium doctor并执行检查, 若无明显报错即安装成功

npm install appium-doctor -gappium-doctor

若出现下面报错

WARN AppiumDoctor ✖ Error running xcrun simctl WARN AppiumDoctor ✖ Xcode Command Line Tools are NOT installed!

则需安装Xcode命令行工具:

xcode-select --install

这将弹出一个对话框,提示您安装命令行工具。点击“安装”,然后等待安装完成。

安装完成后,运行以下命令以确保Xcode命令行工具已正确安装:

xcode-select -p

如果显示了类似于 /Applications/Xcode.app/Contents/Developer 的路径,则说明安装成功。

确保Xcode命令行工具指向正确的路径:

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

安装相关依赖库

brew install libimobiledevice --HEADbrew install carthage

以上安装完毕后

通过Xcode打开appium下的 Contents/Resources/app/node_modules/appium-webdriveragent下scode.project 项目

安装一个ios simulator

连接iphone真机,信任电脑

Product - Destination选择iphone 真机

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com