需要用到工具:
1、GUI 工具,
Airtest
; https://airtest.netease.com/index.html【下载地址】>https://airtest.doc.io.netease.com/en/【文档地址】
2、iOS 代码调试工具,Xcode
;
3、iOS 设备安装工具,WebDriverAgent
,源码,https://github.com/appium/WebDriverAgent【github】
备注,如果不会 Xcode 编辑调试WebDriverAgent
代码的人员,可以找相关开发,要一个 WDA.ipa 安装包即可
WDA.ipa 安装包操作流程【】
1、WebDriverAgent
安装调试
第一步 配置WebDriverAgent
项目
第二步 选择 WebDriverAgentRunner
项目运行到手机上
打包 .ipa
1、配置正确的配置文件
容易遇到的错误
The error message you're encountering typically occurs when there's a mismatch between the provisioning profile being used and the app's entitlements. Specifically, the get-task-allow entitlement is related to whether an app can be debugged. Here's how you can resolve this issue:
Understanding
get-task-allow
get-task-allow Entitlement: This entitlement is set to true for development builds to allow debugging. For distribution builds (Ad Hoc or App Store), it should be set to false .
搜索了一下,没有找到 get-task-allow
相关配置
解决方案,选用 Debug
模式的证书
2、导出 ipa 包
- 执行如下命令前,需要cd到第一步中我们保存的xcode项目文件目录下
xcodebuild build-for-testing -scheme WebDriverAgentRunner -sdk iphoneos -configuration Release -derivedDataPath /tmp/derivedDataPath
- 分步执行如下命令
cd /tmp/derivedDataPath/Build/Products/Release-iphoneos
mkdir Payload && mv *.app Payload
zip -r WDA.ipa Payload
得到 WDA.ipa
在 /private/tmp/derivedDataPath/Build/Products/Release-iphoneos
路径下面
-
ios 17
需要做适配处理【如何不处理,打包出来的 ipa 可以正常安装,但是会直接闪退】
2、安装 Airtest
工具
下载工具进行安装 https://airtest.netease.com/index.html
可能遇到的问题可以查看相关官方文档:https://juejin.cn/post/7439785794916859904
3、Airtest
链接 iOS 设备 Airtest操作文档
- 注意点:未知原因链接不是设备,并检查不到设备可以尝试进行如下命令在
终端
进行
1:brew install libimobiledevice
brew install libimobiledevice
报错
报错
根据命令进行执行brew cleanup libimobiledevice
根据命令进行执行brew reinstall libimobiledevice
报错
根据命令进行执行export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
根据命令进行执行brew reinstall libimobiledevice
成功实力整个流程示例图
整个流程示例图
4、简单使用 Airtest
进行 UI 流程测试
1、简单脚本操作命令、
生成脚本
生成脚本示例