python ios开发环境搭建_Appium+Python3+iOS真机环境搭建
发布日期:2021-06-25 23:15:58 浏览次数:11 分类:技术文章

本文共 2742 字,大约阅读时间需要 9 分钟。

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

转载地址:https://blog.csdn.net/weixin_39669265/article/details/110963976 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:python访问网页增加阅读量_怎样通过Python使用代理IP增加阅读量
下一篇:树莓派人脸识别python_树莓派调用百度人脸识别API实现人脸识别

发表评论

最新留言

很好
[***.229.124.182]2024年04月09日 16时20分07秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章

PyQt5 技术篇-调用文件对话框获取文件、文件夹路径。文件对话框返回选中的多个文件路径 2019-04-27
SSM 整合实现 增删改查、PageHelper 实现分页 2019-04-27
[增删改查] Lucene 5 索引 CRUD 2019-04-27
使用 SpringBoot 写增删改查接口 2019-04-27
初步使用 JFreeChart 生成报表与感受 2019-04-27
前端使用 BootStrap 写一些后台常用的界面 2019-04-27
使用 SpringBoot + Ckeditor 富文本编辑器、图片上传 2019-04-27
全栈式使用 SpringBoot + SpringSecurity 做登录认证 2019-04-27
[Java爬虫] 使用 Jsoup + HttpClient 爬取网页图片 2019-04-27
使用 Git 并借助 Eclipse + Coding 合作开发项目 2019-04-27
[Java爬虫] 使用 Xpath + HtmlUnit 爬取网页基本信息 2019-04-27
[人工智能] 使用百度 API 读取身份证照片的文字 2019-04-27
在SpringBoot中使用【阿里云OSS对象存储】存取图片 2019-04-27
[Java爬虫] 使用 HtmlUnit + Xpath 模拟点击、动态获取信息 2019-04-27
使用 SpringBoot 之 JPA 整合 Redis 实现缓存 2019-04-27
SpringBoot 结合 JSR303 对前端数据进行校验 2019-04-27
SpringBoot 整合 MongoDB 之 MongoTemplate 实现 CRUD、分页接口 2019-04-27
[增删改查] SpringBoot 整合 Solr 之 SolrClient 实现 CRUD、分页接口、高亮显示 2021-06-30
[Python爬虫] 模拟浏览器、代理ip、开启日志、超时处理、异常处理、登录、下载图片 2021-06-30
在 SpringBoot 中使用 @EnableAsync、@Async 轻松实现异步任务 2021-06-30