Appium 是一个自动化测试开源工具,支持 iOS 平台和 Android 平台上的原生应用,web 应用和混合应用。

本次环境配置相关:
macOS:10.13.4
Appium-desktop:1.6.1
Xcode:9.3.1

一、环境配置

1、 安装homebrew:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2、 安装libimobiledevice:

$ brew install libimobiledevice --HEAD

3、 安装carthage:

$ brew install carthage

4、安装node:

$ brew install node

5、安装npm:

$ brew install npm

6、安装ios-deploy:

$ npm install -g ios-deploy

8、安装xcpretty:

$ gem install xcpretty

9、安装appium,appium-doctor

进入官网,下载Appium-1.6.1.dmg,安装即可。

当然你可以使用命令:npm install -g appium来安装appium,但是后面就会各种报错!!

$ npm install -g appium-doctor

10、使用appium-doctor 检查Appium iOS环境环境

appium-doctor --ios

info AppiumDoctor Appium Doctor v.1.4.3
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor ✔ The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor ✔ Node version is 10.1.0
info AppiumDoctor ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor ✔ Xcode Command Line Tools are installed.
info AppiumDoctor ✔ DevToolsSecurity is enabled.
info AppiumDoctor ✔ The Authorization DB is set up properly.
info AppiumDoctor ✔ Carthage was found at: /usr/local/bin/carthage
info AppiumDoctor ✔ HOME is set to: /Users/wangjuan
info AppiumDoctor ### Diagnostic completed, no fix needed. ###
info AppiumDoctor
info AppiumDoctor Everything looks good, bye!
info AppiumDoctor

二、安装WebDriverAgent

1、进入appium安装目录下WebDriverAgent文件夹,具体路径参照自己的路径,可以通过find命令查找

cd /Applications/Appium.app/Contents/Resources/app
/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent

2、在WebDriverAgent目录下执行以下命令

mkdir -p Resources/WebDriverAgent.bundle

sh ./Scripts/bootstrap.sh

3、编译WebDriverAgent.xcodeproj

Xcode打开当前目录下的WebDriverAgent.xcodeproj文件

 
WebDriverAgent.xcodeproj.png

注意:进入项目后要编辑一些内容,请无比按照步骤全部修改。

1、TARGETS->WebDriverAgentLib的Bundle Identifier更改为自己命名的Identifier。(所有Identifier注意保持一致!!)

2、TARGETS->WebDriverAgentLib的Signing选择使用个人的证书。

 
image.png

3、TARGETS->WebDriverAgentRunner的Signing选择使用个人的证书。

 
image.png

4、PROJECT->WebDriverAgent的Product Bundle Identifier更改为自己命名的Identifier。(所有Identifier注意保持一致!!)

 
image.png

5、TARGETS->WebDriverAgentLib的Product Bundle Identifier更改为自己命名的Identifier。(所有Identifier注意保持一致!!)

 
image.png

6、TARGETS->WebDriverAgentRunner的Product Bundle Identifier更改为自己命名的Identifier。(所有Identifier注意保持一致!!)

 
image.png

7、Device选择已连接的测试机

8、点击build按钮来测试,按照步骤设置后,可build succeeded~

 
image.png

9、测试机上安装证书,执行以下命令:
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=测试机的udid' test

如果没有报错证明安装成功,同时手机上会安装一个WebDriverAgent软件。需要在手机设置->通用->设备管理->信任开发者。如下图:

 
image.png
 
image.png

三、Appium Client端

Appium Client有Ruby,Python,Java三个版本,可自行选择自己喜欢的安装即可,本次只针对Python版安装:

pip install Appium-Python-Client

Appium+Python3+iOS真机环境搭建的更多相关文章

  1. Appium+iOS真机环境搭建

    安装目录 1.macOS系统  10.12.6 2.xcode  9.0 3.appium Desktop  1.12.1 4.node.js node -v npm 5.cnpm npm insta ...

  2. Windows系统appium移动端自动化真机环境搭建

    appium-windows-android环境搭建完成以后,就可以进行真机模式下的appium环境搭建啦!! 准备:把要测试的app下载至本机(小波的是把apk放在桌面上,例如:C:\Users\w ...

  3. mac 下 配置appium +ios真机环境

    mac系统:10.11.6 xcode:7 appium:1.5.3 iphone: 6 p 1.搭建 appium 安卓的环境: 1.jdk 2.sdk 3.appium 4.配置环境变量 mac下 ...

  4. Appium安卓真机环境搭建

    说明 步骤可能比较简洁,因为手头上有安卓测试机,所以需要配置虚拟机的童鞋请去虫师博客园,因为我也是从那儿学的,哈哈.点我飞到虫师那儿 但是如果你要搭建真机测试环境的话,本教程将是最简单实用的. 1. ...

  5. Appium robotframework-appium (ios 客户端测试)环境搭建

    一. 简介 1.1摘要 本人测试新人,最近在搞ios客户端的自动化,准备采用robotframework-appium来实现自动化测试,一边学习一边总结,此安装说明文档是基于mac系统10.11版本, ...

  6. 如何在 iOS 真机运行 Appium

    使用 gui 启动的 appium 1.2.2 也会有这个问题,所以你要把 deviceconsole 复制到 /Applications/Appium.app/Contents/Resources/ ...

  7. appium ios真机自动化环境搭建&运行(送源码)

    appium ios真机自动化环境搭建&运行(送源码) 原创: f i n  测试开发社区  6天前 Appium测试环境的搭建相对比较烦琐,不少初学者在此走过不少弯路 首先是熟悉Mac的使用 ...

  8. appium ios真机自动化环境搭建&运行(送源码)

    appium ios真机自动化环境搭建&运行(送源码) 原创: f i n  测试开发社区  6天前 Appium测试环境的搭建相对比较烦琐,不少初学者在此走过不少弯路 首先是熟悉Mac的使用 ...

  9. 搭建Mac+Java+appium+IOS真机自动化环境

    一.安装前环境准备 1.确保电脑已经有homebrew(包管理器)  下载链接[https://brew.sh/]   2.通过 brew 安装node.js brew install node 安装 ...

随机推荐

  1. Docker操作笔记(一)使用镜像

    使用镜像 一)获取镜像 从Docker镜像仓库获取命令的格式是: docker pull [选项] [Docker Registry 地址[:端口号]] 仓库名[:标签] 具体的选项可以通过docke ...

  2. [CF542D]Superhero's Job

    [CF542D]Superhero's Job 题目大意: 定义函数 \[ J(x) = \sum_{\substack{1 \leq k \leq x \\ k \mid x \\ \gcd \le ...

  3. idea使用配置

    一,打开窗口多行显示, Window→Editor Tabs→Tabs Placement→Show Tabs in Single Row 取消选中后即可在多行显示 2 .还可以自行设置打开文件窗口数 ...

  4. 什么是 js 变量提升 (Javascript Hoisting)

    Javascript是一门容易遭人误解的语言,但是它的强大毋庸置疑.个人觉得,要想深入理解Javascript语言,首先必须对其基本的概念(例如:Scope,Closure,Hoisting等)要真正 ...

  5. ElasticSearch 一

    一:elasticSearch的目录结构的分类 /bin 运行ElasticSearch实例和管理插件呢的一些脚本 /config 配置文件 路径,包含elasticsearch.yml /data ...

  6. 解密Redis的持久化和主从复制机制

    Redis持久化 Redis 提供了多种不同级别的持久化方式: RDB 持久化可以在指定的时间间隔内生成数据集的时间点快照(point-in-time snapshot). AOF 持久化记录服务器执 ...

  7. 隐藏状态栏,toolbar前面空格问题,editText圆角

    EditText圆角: 一.在drawable下面添加xml文件rounded_editview.xml 复制代码 代码如下: <?xml version="1.0" enc ...

  8. 图片上传组件webuploader

    前端组件webuploader 当时也是搞了很久参考这种demo,但是没记.现在事后大致总结下.直接上大概代码(我使用asp.net  MVC来做的): 执行顺序:(get)Record/Add——A ...

  9. python基础之类的多态与多态性

    原文链接:https://www.cnblogs.com/luchuangao/p/6739557.html 很多人喜欢将多态与多态性二者混为一谈,然后百思不得其解,其实只要分开看,就会很明朗. 一 ...

  10. 洛谷P4051 字符加密 [JSOI2007] SA

    正解:SA 解题报告: 传送门! 和工艺那题有点儿像鸭,,,反正肯定就都想到倍长然后SA拍个序嘛先 然后就做完了,,,我发现SA的题刷起来特别susi,,,基本上紫题级别的都just一个模板就欧克了最 ...