ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

IOS UI自动化测试环境搭建

2022-03-19 23:31:12  阅读:217  来源: 互联网

标签:node appium app IOS UI install macaca WebDriverAgent 测试环境


        

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}

标签:node,appium,app,IOS,UI,install,macaca,WebDriverAgent,测试环境
来源: https://blog.csdn.net/ggsz520/article/details/123605445

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有