IOS UI自动化测试环境搭建

        

Xcode

App Stroe 下载安装Xcode

安装完成之后检查版本: xcodebuild -version

Xcode Command Line Tools

命令行输入:xcode-select --install

Brew

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

brew install ideviceinstaller

brew install libimobiledevice

brew install ios-deploy

Carthage

  1. 安装Carthage
  2. brew install carthage
  3. 检查carthage
  4. carthage version

WebDriverAgent

有2中方式启动webdriveragent

  1. 官方下载
  2. 使用appium 自带的 /Users/admin/nodejs/node_global/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj
  3. 命令行启动
  4. xcodebuild -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'platform=iOS Simulator,name=iPhone 12 Pro Max' test
  5. 查看ios模拟器信息xcrun simctl list | grep "Booted"
  6. 解锁keychain,以便可以正常的签名应用,PASSWORD="replace-with-your-password"security unlock-keychain -p $PASSWORD ~/Library/Keychains/login.keychain
  7. # 获取设备的UDIDUDID=$(idevice_id -l | head -n1)# 真机运行测试xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination "id=$UDID" test# 模拟器运行测试xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination "platform=iOS Simulator,name=iPhone X" test

模拟器相关

查看模拟器:xcrun instruments -s

启动模拟器:xcrun instruments -w 93EAE4C0-70D4-4A9B-A04E-E21E1B53A911(udid)

真机相关 

查看连接的真机: idevice_id -l

查看真机安装的app:  ideviceinstaller -l

查看真机信息:ideviceinfo

Macaca (元素定位)

  1. 安装macaca-cli
  2. npm install -g macaca-cli
  3. 安装macaca-doctor
  4. npm install -g macaca-doctor
  5. 检查macaca环境: macaca doctor
  6. 安装macaca-ios:
  7. npm install -g macaca-ios
  8. 安装app-inspector
  9. npm install -g app-inspector
  10. 运行 app-inspector
  11. app-inspector -u {apple_uuid}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值