热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

mac配置python+appnium--iOS版-真机(三)

本文主要介绍关于测试工具,自动化,xcode,python的知识点,对【mac配置python+appnium--iOS版-真机(三)】和【python获取mac地址】有兴趣的朋友可以看下由【测试小

本文主要介绍关于测试工具,自动化,xcode,python的知识点,对【mac配置python+appnium--iOS版-真机(三)】和【python 获取mac地址】有兴趣的朋友可以看下由【测试小小苏】投稿的技术文章,希望该技术和经验能帮到你解决你所遇的appium相关技术问题。

python 获取mac地址

本节来看看真机上appium如何启动ios的app

1、安装Carthage

brew install carthage

2、安装依赖:
Appium iOS真机测试依赖于中心第三方软件套件:libimobiledevice, 用homebrew安装:

brew install libimobiledevice

Appium支持真机在iOS 9.3以上版本使用Xcode 8+ 还要依赖于ios-deploy,通过npm安装:

npm install -g ios-deploy

3、 安装WebDriverAgent项目,appium一般自带了

自带:

Appium.app->右键-显示包内容->Contents,然后搜索WebDriverAgent.xcodeproj,点击在上层文件夹中显示,将新打开的文件,全部复制到一个新的文件夹中。

没自带,下载:

https://github.com/facebookarchive/WebDriverAgent

可以直接下载,也可以命令行使用git下载:

git clone https://github.com/facebookarchive/WebDriverAgent.git  

下载之后进入WebdriverAgent的路径中执行:

cd WebDriverAgent

./Scripts/bootstrap.sh

4、Xcode打开项目,配置证书

配置WebDriverAgentLib,Team输入苹果账号密码

配置WebDriverAgentRunner

 如图所示,会出现报错提示,进入WebDriverAgentRunner -> Build Settings设置中,找到Packaging中的选项,将其内容修改为唯一识别的字符串:

再回来看报错信息就没有了

 5、Product>Destination,选择你的设备

 Product>Scheme,选择WebDriverAgent

 6、Product>Test,运行项目

这个时候手机上会成功安装上WebDriverAgent,首次安装需要手机上设置信任,路径为设置>通用>描述文件与设备管理,找到WebDriverAgent并设置信任

 

7、点击图中的图标或View>Debug Area>Activate Console可以查看控制台日志

浏览器中输入127.0.0.1:8100/status返回一串字符串则成功

如果没有返回内容,则需要做端口转发,命令行输入:

brew install libimobiledevice --HEAD

iproxy 8100 8100

再次刷新页面即加载成功

8、appium inspector中连接手机


{
  "appium:platformVersion": "14.4.1",
  "platformName": "iOS",
  "appium:automationName": "XCUITest",
  "appium:deviceName": "iPhone Xs",
  "appium:bundleId": "com.xxx.xx",
  "appium:udid": "xx"
}

  "appium:automationName": "XCUITest",这一行可以不填

platformVersion、deviceName、udid、bundleId可以在Xcode中查看

Window>Devices and Simulators

点击Open Console查看app的bundleId

运行app,在process列中找到SpringBoard, Message列中找到 Bootstrapping, bundleId 类似于com.xxxx.xxx.xxx

appium inspector中执行json,如果出现Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65,拔出USB再插上试试...,需要注意的是,必须先在Xcode中运行WebDriverAgent,再使用appium调用app。

本文《mac配置python+appnium--iOS版-真机(三)》版权归测试小小苏所有,引用mac配置python+appnium--iOS版-真机(三)需遵循CC 4.0 BY-SA版权协议。


推荐阅读
author-avatar
处男是你_909
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有