IOS 自动化测试环境搭建

  1. 购买Mac

PDD 比TB JD 便宜500,下单

  1. 安装homebrew

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
  1. 安装npm cnpm

brew install node;
npm install -g cnpm --registry=https://registry.npm.taobao.org;
  1. 安装类似Android的adb

安装 libimobiledevice, ideviceinstaller:

brew install libimobiledevice;
brew install ideviceinstaller;
  1. 安装Appium 

Requirements

  • macOS, Linux or Windows operating system

  • Node.js 14+

  • NPM (Node Package Manager) 8+

命令行安装

sudo cnpm install -g appium

Gui安装

https://github.com/appium/appium-desktop/releases/latest

  1. 安装Appium Inspector

https://github.com/appium/appium-inspector/releases/tag/v2022.11.1

官网下载太慢,所以上传CSDN

  1. 安装Xcode

App Store

  1. Build WDA

  1. 下载WDA代码

推荐github desktop 下载代码,简单方便快捷

https://github.com/appium/WebDriverAgent

  1. 打开手机的开发者模式,连接Mac

  1. Xcode 打开并且修改 签名数据

这块参考

https://blog.csdn.net/liuage_/article/details/124508920

(1) 设置【WebDriverAgentLib】、【WebDriverAgentRunner】、【IntegrationApp】的Team,选择自己登录的Apple ID,登录Apple ID:(左上角Xcode-》Preferrence-》点击下面的进行增删)

(2)设置【WebDriverAgentRunner】、【IntegrationApp】Build Settings下Packaging目录下Product Bundle Identifier的id,把其中facebook改掉就行,自己随意改

(3) 设置【Product】→【Scheme】选择【WebDriverAgentRunner】

(4) 选中自己连接的设备,command + u 运行即可

(5) 第一次运行需要在真机设置里面给证书设置信任【设置】→【通用】→【VPN与设备管理】选择开发者APP下面刚安装的WebDriverAgent信任即可,在次command+u即可正常运行,启动成功后Xcode下面会出一串URL

(6) 然后关闭Xcode服务 ,Xcode也可以关闭了,WebDriverAgent配置完成

  1. 使用Inspector查看手机

  1. 打开appium Gui

默认设置

  1. 打开appium inspector 

remote path /wd/hub/

配置

{
  "platformName": "ios",//苹果手机默认
  "appium:platformVersion": "16.1",//ios版本
  "appium:udid": "xxxxx-00113xxx",//idevice_id -l 
  "appium:deviceName": "SuperXX",//设备名
  "appium:automationName": "Appium",//默认
  "xcodeSigningId":"iPhone Developer",//默认
  "xcodeOrgId":"WS6RPRBF68" //keychain 组织单位
}

搞定

10. 问题合集

TBD

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值