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

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

Xcode download: Sign In - Apple

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

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

安装homerew

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

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

安装appium server

bash 复制代码
npm install -g appium@next

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

bash 复制代码
appium driver install xcuitest

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

bash 复制代码
npm install appium-doctor -g

appium-doctor

若出现下面报错

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

则需安装Xcode命令行工具:

bash 复制代码
xcode-select --install

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

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

bash 复制代码
xcode-select -p

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

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

bash 复制代码
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

安装相关依赖库

bash 复制代码
brew install libimobiledevice --HEAD

brew install carthage

以上安装完毕后

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

安装一个ios simulator

连接iphone真机,信任电脑

Product - Destination选择iphone 真机

相关推荐
openinstall全渠道统计3 小时前
免填邀请码工具:赋能六大核心场景,重构App增长新模型
android·ios·harmonyos
Macdo_cn4 小时前
Infuse Pro for Mac v8.1 全能视频播放器 支持M、Intel芯片
macos·音视频
软件技术NINI7 小时前
Deepseek本地部署指南:在linux服务器部署,在mac远程web-ui访问
linux·服务器·macos
早起的年轻人8 小时前
Flutter CupertinoNavigationBar iOS 风格导航栏的组件
flutter·ios
貂蝉空大10 小时前
uni-app开发安卓和ios app 真机调试
android·ios·uni-app
胖虎111 小时前
iOS 中的圆角与平滑圆角:从新特性到老项目适配
ios·圆角·平滑圆角·cornercurve
志飞11 小时前
ios UICollectionView使用自定义UICollectionViewCell
ios·collectionview·自定义cell
清风细雨_林木木12 小时前
Mac 清理缓存,提高内存空间
macos·缓存
Macdo_cn12 小时前
Screen Wonders for Mac v3.3.1 3D屏保应用 支持M、Intel芯片
macos·音视频
闲猫16 小时前
go WEB框架
前端·golang·web·xcode