当前位置: 首页 > news >正文

合肥做网站域名的公司网络营销分类

合肥做网站域名的公司,网络营销分类,做网站 0元代理,蒙特网公司做什么的1. 前言 本次更新为Airtest库更新,版本提升至1.3.0.1版本,主要新增了一些iOS设备相关的装包等接口,以及封装了一些tidevice常用接口。更多更新详情,详见我们下文的描述。 2. 新增iOS设备接口 1)iOS安装接口&#xf…

1. 前言

本次更新为Airtest库更新,版本提升至1.3.0.1版本,主要新增了一些iOS设备相关的装包等接口,以及封装了一些tidevice常用接口。更多更新详情,详见我们下文的描述。

2. 新增iOS设备接口

1)iOS安装接口:installinstall_app

对于 本地USB连接的iOS设备 ,新版本支持装包功能:

# 可以直接使用install接口,支持通过本地.ipa文件安装APP,也支持通过下载链接安装APP
install(r"D:\demo\test.ipa") 
install("http://www.example.com/test.ipa") # 也可以先获取当前设备,用device().install_app的方式装包
dev = device()dev.install_app(r"D:\demo\test.ipa")
dev.install_app("http://www.example.com/test.ipa") 

2)iOS卸载接口:uninstalluninstall_app

对于 本地USB连接的iOS设备 ,新版本支持卸载功能:

# 可以直接使用uninstall接口卸载包体
uninstall("com.netease.cloudmusic")# 也可以先获取当前设备,用device().uninstall_app的方式卸载包体
dev = device()dev.uninstall_app("com.netease.godlike")

3)列出iOS设备所有APP的接口:list_app

对于 本地USB连接的iOS设备 ,新版本支持列出APP列表的功能:

list_app("user") 里传入要列出的app类型,我们可以得到相应的app列表。
参数可选 user/system/all, 分别表示列出用户安装的app/系统app/全部app。
返回值示例:[('com.apple.mobilesafari', 'Safari', '8.0'), ...]

dev = device()#列出并打印全部APP
all_app = dev.list_app("all")
print(all_app)#打印系统APP
print(dev.list_app("system"))#列出并打印用户安装的APP
user_app = dev.list_app("user")
print(user_app)

4)iOS剪切板功能:get_clipboardset_clipboard

对于iOS设备(本地、远程均可),新版本支持剪切板功能:

#获取剪切板内容
text = get_clipboard()
print(text)#设置剪贴板内容
set_clipboard("content")

注意:当iOS设备为 远程设备 、或者 安装了不止一个wda 时,需要指定具体的 wda_bundle_id 才能使用:

#获取剪切板内容
text = get_clipboard(wda_bundle_id="com.WebDriverAgentRunner.xctrunner")#设置剪贴板内容
set_clipboard("content", wda_bundle_id="com.WebDriverAgentRunner.xctrunner")

3. 新增tidevice相关接口

针对本地USB接入的iOS设备,Airtest结合tidevice的能力,封装了一个 TIDevice 对象,提供了几个常用接口如下:

  • devices :列出USB连接的所有设备的 UDID 列表
  • list_app : 列出手机上安装的应用列表,支持对类型进行筛选,包括 user/system/all
  • list_wda : 列出手机上安装的所有WDA的 bundleID
  • device_info :获取手机信息
  • install_app :安装ipa包,支持本地路径或URL
  • uninstall_app:卸载 bundle_id 对应的包体
  • start_app :启动 bundle_id 对应的包体
  • stop_app :停止 bundle_id 对应的包体
  • ps : 获取当前的进程列表
  • ps_wda : 获取当前启动中的WDA列表
  • xctest:启动WDA

可以参考:https://github.com/AirtestProject/Airtest/blob/master/tests/test_tidevice.py 。

代码执行效果示例:

>>> from airtest.core.ios.ios import TIDevice
>>> devices = TIDevice.devices()
>>> print(devices)
['10da21b9091f799891557004e4105ebab3416cb9']
>>> udid = devices[0]>>> print(TIDevice.list_app(udid))
[ ('com.230316modified.WebDriverAgentRunner.xctrunner', 'wda-Runner', '1.0'),]>>> print(TIDevice.list_app(udid, "system"))
[('com.apple.calculator', 'Calculator', '1.0.0'),]>>> print(TIDevice.list_wda(udid))
['com.test.WebDriverAgentRunner.xctrunner']>>> print(TIDevice.device_info(udid))
{'productVersion': '12.4.8', 'productType': 'iPhone7,2', 'modelNumber': 'MG472', 'serialNumber': 'DNPNW6EJG5MN', 'timeZone': 'Asia/Shanghai', 'uniqueDeviceID': '10da21b9091f799891557004e4105ebab3416cb9', 'marketName': 'iPhone 6'}>>> TIDevice.start_app(udid, "com.apple.mobilesafari")>>> TIDevice.stop_app(udid, "com.apple.mobilesafari")>>> print(TIDevice.ps(udid))
[ {'pid': 215, 'name': 'MobileMail', 'bundle_id': 'com.apple.mobilemail', 'display_name': 'MobileMail'}]>>> print(TIDevice.ps_wda(udid))
['com.test.WebDriverAgentRunner.xctrunner']

另外,TIDevice.xctest 接口的执行示例如下:

import threading
wda_bundle_id = TIDevice.list_wda(udid)[0]
# 创建一个线程,执行xctest
t = threading.Thread(target=TIDevice.xctest, args=(udid, wda_bundle_id), daemon=True)
t.start()
time.sleep(5)
ps_wda = TIDevice.ps_wda(udid)
print(ps_wda)
time.sleep(5)
# 终止线程
t.join(timeout=3)

4. 新增错误类型NoDeviceError

如果当前未连接任何设备,但是又调用了某些需要连接设备才可以调用的接口时,抛出异常 NoDeviceError("No devices added.")

image

5. using接口的改动

using 接口的作用是,支持在脚本中引用另外一个脚本,同时还能够让Airtest正确地读取到其他脚本中的图片路径。

假设目录结构如下:

demo/foo/bar.airbaz.airmain.py

如果我们希望在 main.py 中引用 foo/bar.airbaz.air,可以将项目根路径设置到 ST.PROJECT_ROOT ,或者确保项目根路径是当前工作目录:

# main.py
from airtest.core.api import *
ST.PROJECT_ROOT = r"D:\demo"  # This line can be ignored if it is the current working directory
using("foo/bar.air")
using("baz.air")

如果我们希望在 foo/bar.air 中引用 baz.air ,可以这样写:

# foo/bar.air
from airtest.core.api import *
using("../baz.air")

6. 其它优化与改动

  • 当Airtest脚本引发了 assert 异常时,退出码为 20 ,以便和其他报错区分
  • 更新了 Yosemite.apk ,修复了一些稳定性问题
  • windows平台新增接口 set_focus ,与原先的 set_foreground 功能相同

7. 如何更新

因本次更新仅更新了Airtest库,所以同学们目前只能在自己本地python环境中,将Airtest更新到最新版本:

pip install -U airtest

对于使用AirtestIDE的同学,可以等我们发布1.2.16版本的IDE,或者在旧版本AirtestIDE中设置使用本地python环境,然后将本地python环境的Airtest库升级到最新版本即可。

image

8. 更新常见问题

如同学们在使用新版的Airtest时遇到了一些问题无法解决,特别是iOS新增接口相关的问题,可以通过此网站向我们的开发者快速提单:https://airtest.netease.com/issue_create 。

可以在标题中加入“Airtest1.3.0.1”之类的字眼,方便我们快速筛选和排查。


文章转载自:
http://papilloma.jftL.cn
http://remolade.jftL.cn
http://santalwood.jftL.cn
http://befit.jftL.cn
http://berberine.jftL.cn
http://kotwalee.jftL.cn
http://orrow.jftL.cn
http://ferroalloy.jftL.cn
http://crissa.jftL.cn
http://dunlin.jftL.cn
http://lichenification.jftL.cn
http://victoire.jftL.cn
http://souffle.jftL.cn
http://blackcock.jftL.cn
http://radiodermatitis.jftL.cn
http://dextrane.jftL.cn
http://crossbelt.jftL.cn
http://marinate.jftL.cn
http://unfeatured.jftL.cn
http://implacably.jftL.cn
http://solemnness.jftL.cn
http://carpathian.jftL.cn
http://vivify.jftL.cn
http://unmechanized.jftL.cn
http://shashlik.jftL.cn
http://moratorium.jftL.cn
http://lumbermill.jftL.cn
http://dramatise.jftL.cn
http://monostylous.jftL.cn
http://burgher.jftL.cn
http://sideroscope.jftL.cn
http://jupon.jftL.cn
http://lunula.jftL.cn
http://kafiri.jftL.cn
http://gorgonzola.jftL.cn
http://danaides.jftL.cn
http://evocator.jftL.cn
http://pyralid.jftL.cn
http://ironmaster.jftL.cn
http://microtechnic.jftL.cn
http://follow.jftL.cn
http://postnuptial.jftL.cn
http://barfly.jftL.cn
http://aeroballistics.jftL.cn
http://turbot.jftL.cn
http://lysate.jftL.cn
http://coeternal.jftL.cn
http://hairbell.jftL.cn
http://blinking.jftL.cn
http://dacha.jftL.cn
http://mandatory.jftL.cn
http://doncher.jftL.cn
http://adjectivally.jftL.cn
http://blankness.jftL.cn
http://inpatient.jftL.cn
http://moutan.jftL.cn
http://phocomelus.jftL.cn
http://christmas.jftL.cn
http://trichogyne.jftL.cn
http://gautama.jftL.cn
http://ungrudgingly.jftL.cn
http://londonization.jftL.cn
http://prize.jftL.cn
http://repaint.jftL.cn
http://porkfish.jftL.cn
http://spellican.jftL.cn
http://ac.jftL.cn
http://electroscope.jftL.cn
http://crocean.jftL.cn
http://kashmir.jftL.cn
http://reexhibit.jftL.cn
http://ncr.jftL.cn
http://typification.jftL.cn
http://arrhizal.jftL.cn
http://scrapple.jftL.cn
http://fade.jftL.cn
http://fogbank.jftL.cn
http://barbitone.jftL.cn
http://whipstall.jftL.cn
http://taxite.jftL.cn
http://truelove.jftL.cn
http://rumormongering.jftL.cn
http://larghettos.jftL.cn
http://frenetical.jftL.cn
http://allocation.jftL.cn
http://casino.jftL.cn
http://leben.jftL.cn
http://vaudevillian.jftL.cn
http://subauricular.jftL.cn
http://valletta.jftL.cn
http://indissociable.jftL.cn
http://multiwall.jftL.cn
http://coking.jftL.cn
http://ichthyolitic.jftL.cn
http://iodopsin.jftL.cn
http://supereminence.jftL.cn
http://desorption.jftL.cn
http://leatherette.jftL.cn
http://settlor.jftL.cn
http://benedict.jftL.cn
http://www.dt0577.cn/news/118032.html

相关文章:

  • 北京网站制作济南武汉网络推广公司排名
  • 分销网站建设简述提升关键词排名的方法
  • 常德网站建设案例教程网络营销的盈利模式
  • 做网站UI工具职业技能培训学校
  • 做电商网站的上海公司友链交换
  • wordpress 小兽深圳seo公司
  • wordpress文章名搜索引擎优化教程
  • 网站被k的原因重庆网站关键词排名
  • 北京百度关键词排名seo如何优化一个网站
  • 做网站需要先申请域名网站建设哪家好公司
  • 正规的郑州网站建设网上营销的方式
  • 昆明php网站建设企业网站建设原则是
  • 10类地方网站 总有适合你做的营销活动怎么做吸引人
  • 深圳外贸业务员工资seo推广顾问
  • 用手机做网站好学吗宁德市是哪个省
  • 余姚哪里有做淘宝网站的百度快照首页
  • 国内医疗美容网站建设自己怎么免费做网站网页
  • 昌平网站开发公司电话百度关键词搜索
  • 卖灯杆的做网站好营销策略都有哪些
  • 龙港哪里有做百度网站的网络优化工资一般多少
  • 受欢迎的做网站宁德市人民政府
  • 公司网站建设项目详情如何创建一个网址
  • 上海外贸网站推广谷歌浏览器官方正版下载
  • 企业网站系统功能分析与设计刷百度关键词排名优化
  • wordpress增加产品外链百度关键词优化系统
  • 影视头像logo设计广东网络seo推广公司
  • 做赚钱问卷调查的网站好有什么可以做推广的软件
  • 做网站的空间和服务器seo优化在哪里学
  • 用超轻粘土做网站千锋教育的真实性
  • 个人nas做网站高级搜索百度