macOS相关库安装

* libimobiledevice

brew install libimobiledevice

使用本机与iOS设备的服务进行通信的库。

* ideviceinstaller

brew install ideviceinstaller

获取设备uuid、安装app、卸载app、获取bundleid。

* carthage

brew install carthage

第三方库管理工具。

* ios-deploy

brew install ios-deploy

ios-deploy不依赖于xcode进行安装和调试iOS应用程序。

* node & npm

brew install node

brew install npm

* appium-doctor

npm install -g appium-doctor

* 验证appium环境

> appium-doctor

info AppiumDoctor Appium Doctor v.1.16.0

info AppiumDoctor ### Diagnostic for necessary dependencies starting ###

info AppiumDoctor ✔ The Node.js binary was found at: /usr/local/bin/node

info AppiumDoctor ✔ Node version is 15.5.1

info AppiumDoctor ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer

info AppiumDoctor ✔ Xcode Command Line Tools are installed in: /Applications/Xcode.app/Contents/Developer

info AppiumDoctor ✔ DevToolsSecurity is enabled.

info AppiumDoctor ✔ The Authorization DB is set up properly.

info AppiumDoctor ✔ Carthage was found at: /usr/local/bin/carthage. Installed version is: 0.36.0

info AppiumDoctor ✔ HOME is set to: /Users/sven

WARN AppiumDoctor ✖ ANDROID_HOME environment variable is NOT set!

WARN AppiumDoctor ✖ JAVA_HOME environment variable is NOT set!

WARN AppiumDoctor ✖ adb, android, emulator could not be found because ANDROID_HOME or ANDROID_SDK_ROOT is NOT set!

WARN AppiumDoctor ✖ Cannot check $JAVA_HOME requirements since the environment variable itself is not set

info AppiumDoctor ### Diagnostic for necessary dependencies completed, 4 fixes needed. ###

info AppiumDoctor

info AppiumDoctor ### Diagnostic for optional dependencies starting ###

WARN AppiumDoctor ✖ opencv4nodejs cannot be found.

info AppiumDoctor ✔ ffmpeg is installed at: /usr/local/bin/ffmpeg. ffmpeg version N-100459-ga7f9b3b954 Copyright (c) 2000-2020 the FFmpeg developers

WARN AppiumDoctor ✖ mjpeg-consumer cannot be found.

WARN AppiumDoctor ✖ set-simulator-location is not installed

WARN AppiumDoctor ✖ idb and idb_companion are not installed

WARN AppiumDoctor ✖ applesimutils cannot be found

info AppiumDoctor ✔ ios-deploy is installed at: /usr/local/bin/ios-deploy. Installed version is: 1.11.3

WARN AppiumDoctor ✖ bundletool.jar cannot be found

WARN AppiumDoctor ✖ gst-launch-1.0 and/or gst-inspect-1.0 cannot be found

info AppiumDoctor ### Diagnostic for optional dependencies completed, 7 fixes possible. ###

info AppiumDoctor

info AppiumDoctor ### Manual Fixes Needed ###

info AppiumDoctor The configuration cannot be automatically fixed, please do the following first:

WARN AppiumDoctor ➜ Make sure the environment variable ANDROID_HOME is properly configured for the Appium process. Refer https://github.com/appium/java-client/blob/master/docs/environment.md for more details.

WARN AppiumDoctor ➜ Make sure the environment variable JAVA_HOME is properly configured for the Appium process. Refer https://github.com/appium/java-client/blob/master/docs/environment.md for more details.

WARN AppiumDoctor ➜ Manually configure ANDROID_HOME and run appium-doctor again.

WARN AppiumDoctor ➜ Set $JAVA_HOME environment variable to the root folder path of your local JDK installation

info AppiumDoctor

info AppiumDoctor ### Optional Manual Fixes ###

info AppiumDoctor The configuration can install optionally. Please do the following manually:

WARN AppiumDoctor ➜ Why opencv4nodejs is needed and how to install it: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/image-comparison.md

WARN AppiumDoctor ➜ mjpeg-consumer module is required to use MJPEG-over-HTTP features. Please install it with 'npm i -g mjpeg-consumer'.

WARN AppiumDoctor ➜ set-simulator-location is needed to set location for Simulator. Please read https://github.com/lyft/set-simulator-location to install it

WARN AppiumDoctor ➜ Why idb is needed and how to install it: https://github.com/appium/appium-idb

WARN AppiumDoctor ➜ Why applesimutils is needed and how to install it: http://appium.io/docs/en/drivers/ios-xcuitest/

WARN AppiumDoctor ➜ bundletool.jar is used to handle Android App Bundle. Please read http://appium.io/docs/en/writing-running-appium/android/android-appbundle/ to install it

WARN AppiumDoctor ➜ gst-launch-1.0 and gst-inspect-1.0 are used to stream the screen of the device under test. Please read https://appium.io/docs/en/writing-running-appium/android/android-screen-streaming/ to install them and for more details

info AppiumDoctor

info AppiumDoctor ###

info AppiumDoctor

info AppiumDoctor Bye! Run appium-doctor again when all manual fixes have been applied!

info AppiumDoctor

xcode

xcode是iOS开发环境,可以到appstore下载安装。

xcode的安装需要macOS升级到最新的版本,如果你的系统不是最新版本需要升级。

webDriverAgent

在模拟器中运行的用于iOS的WebDriver服务器。

https://github.com/appium/WebDriverAgent

该项目由facebook开发,appium拉了个分支来维护,更新上超过了facebook,所以我们用appium的分支。

* 通过git clone将项目克隆下来。

* 进入项目目录执行shell脚本:

../WebDriverAgent> ./Scripts/bootstrap.sh

* 通过xcode导入WebDriverAgent项目

找到build Setting -->packaging --> Product Bundle Identifier 选项,将值修改为唯一识别的字符串。

Build Phases --> Copy frameworks -->检查框架。

*RoutingHTTPServer.framework

*YYCache.framework

如果没有这些框架,点击下方加号+添加。

iPhone

准备一部iPhone手机,通过数据线与PC进行连接。

1、选择连接的手机

2、菜单栏:product --> Scheme --> WebDriverAgentRunner

3、在iPhone手机上打开设置:通用 --> 描述文件与设备管理 --> 开发者App,设置 App Development xxxxxx在此iPhone上受信任。

4、菜单栏: procudt -- > Test

5、检查日志是否有错误。

iproxy

安装usbmuxd,他自带了iproxy小工具,iproxy将设备上的端口映射到电脑上的某个端口。

brew install usbmuxd

iproxy 8100 8100

http://localhost:8100/status

开始测试

可以开始测试了,可以有如下几种选择:

* appium

https://github.com/appium/python-client

* Openatx

https://github.com/openatx/facebook-wda

我选 openatx/fackbook-wda,因为他更加简单。

安装:

pip3 install -U facebook-wda

测试脚本:

import wda

c = wda.Client('http://localhost:8100')

print (c.status())

结果

AttrDict({'message': 'WebDriverAgent is ready to accept commands', 'state': 'success', 'os': {'testmanagerdVersion': 28, 'name': 'iOS', 'sdkVersion': '14.2', 'version': '14.1'}, 'ios': {'ip': '192.168.118.140'}, 'ready': True, 'build': {'time': 'Mar 25 2021 14:22:55', 'productBundleIdentifier': 'com.facebook.WebDriverAgentRunner'}, 'sessionId': None})

好了,到此环境就搭建完毕!

android和ios测试环境搭建,iOS自动化测试环境搭建相关推荐

  1. Mac 搭建Appium自动化测试环境

    Mac 搭建Appium自动化测试环境 环境搭建列表 通用环境 Ⅰ 安装 Homebrew Ⅱ 安装 Node & NPM Ⅲ 安装 JDK Ⅳ 安装 Carthage Ⅴ 安装 Appium ...

  2. c fread 快读 详解_万事开头难,手把手教你搭建Appium自动化测试环境,实践案例详解...

    随着移动互联网的发展,各行各业纷纷引入了移动端相关测试技术,很多公司都已经研发了基于Web前端与App端的相关应用程序,为了更好的保证软件测试的质量,移动端自动化测试已走进测试世界,随着终端特性的多机 ...

  3. Windows下搭建Airtest自动化测试环境

    一.下载python <1>去官网下载: https://www.python.org/ <2> 百度网盘分享,python-3.5.1.exe: 链接:https://pan ...

  4. 一文,教你搭建前端自动化测试环境

    前言 最近在看前端自动化测试相关的东西,在搭建环境的时候发现还是有许多需要注意的地方,而且网上很少有将各种测试(单元测试,集成测试,端对端测试)的环境搭建都提及的文章,对像我这样的新手不太友好,于是便 ...

  5. 持续集成:jmeter+ant+jenkins搭建接口自动化测试环境

    1.介绍 Jmeter是一个Java开发的,apache下的开源工具,常被用于做接口自动化和性能测试工具.因为他开源,入手也非常简单,所以越来越受测试人员青睐. ant也是用Java开发的,apach ...

  6. 搭建接口自动化测试环境,这3个工具就够了

    前言 本篇教程是基于Windows操作系统下搭建jmeter+ant+jenkins.我们直接看下优化好的报告图: 01 环境准备 1.jdk1.8以上: jdk安装教程详细参考: ①win:http ...

  7. 软件测试(五)ios测试1-屏蔽 iOS 系统升级提示的方法

    原文地址:https://medium.com/@iosight/how-to-disable-iphone-ota-updates-without-jailbreaking-476830197a1a ...

  8. linux firefox xvfb,持续集成:采用Xvfb+Selenium+Firefox搭建linux服务器下的自动化测试环境...

    自动化测试属于软件测试的一部分,QTP.LoadRunner等都可以编写自动化测试脚本,但是QTP.LoadRunner等工具毕竟还需要人工操作,在持续集成思想下,软件应该自动发布并且自动测试,这样可 ...

  9. seleninum + testNG + reportNG在Windows7搭建自动化测试环境

    自动化,不可逃避的问题.还好环境配置越来越集成化,相对于最原始的安装简单了许多. 最近看客户使用selenium + testng + reportng搭建的自动化测试环境,将整个环境进行了层次化,想 ...

  10. 《手把手教你》系列基础篇之(一)-java+ selenium自动化测试-环境搭建(上)(详细教程)

    1.简介 jmeter系列的文章结束,本来想趁热打铁顺别将Jmeter和接口测试介绍一下,但是感觉Jmeter时间太长了怕大家吃腻了,还有一个原因就是许多小伙伴们或者童鞋们私信问宏哥什么时候可以有ja ...

最新文章

  1. Ubuntu12.04安装Mac OSX Yosemite
  2. Spring的事务管理1
  3. 在图形化界面中为Ubuntu18.04更新源
  4. Jackson 注解 -- 忽略空字段
  5. [css] ui设计中px、pt、ppi、dpi、dp、sp之间的关系?
  6. 分段二次插值例题_分段三次插值
  7. 当自己颓废的时候怎么激励自己?深度好文!!!
  8. opencv+resize+padding+concate
  9. 华为数通ensp命令(三)
  10. sever串口wifi拓展板_什么是串口WIFI模块
  11. journalctl查看服务日志
  12. kafka数据保存时间问题与kafka的性能测试
  13. 【友盟+】于晓航:大数据“格物致知”
  14. 华硕天选2和华硕天选3哪个好 华硕天选2和华硕天选3区别
  15. 红烧茄条————————炒茄子不费油却很好吃的办法
  16. 信息安全--身份认证
  17. 安卓开发之 在应用中使用数据库
  18. Visual SVN Server的下载和使用
  19. 蓝桥杯试题:Fibonacci数列
  20. android 对话框大全,Android 对话框(Dialog)大全

热门文章

  1. rabbitmq reply-code=404, reply-text=NOT_FOUND
  2. Secret Layer Ligh(数据加密成图片)v2.7.2绿色版
  3. ffmpeg 合并拼接 mp4视频
  4. 如何将二维码数据换行显示
  5. 7步快速下载谷歌GoogleEarth三维地形图
  6. 904. 水果成篮(数组、滑动窗口)
  7. 我的大学 --- 郭天祥【4】
  8. docker: error pulling image configuration
  9. 怎样降低计算机屏幕亮度,如何调低电脑屏幕亮度【解决步骤】
  10. 微信公众平台之CURL应用access_token