iOS 自动化可以做到和 Android 一样的流利
已发,期待大佬回复!
加 VX,15906217298,我发你
需要仔细看下 readmine,里面的 minicap 文件都有的
手里没有小米 9 的设备
我这边因为没有用 minitouch,所以没有遇到你的问题。我也可能没有明白的问题,要不你试试 MTC 真机的效果,里面的真机服务是我们提供的,右边的工具栏应用列表,启动、卸载应用都是用的 adb shell 命令,看看有没有你的现象。
感谢提醒哈,我来看看哈
代码就不共享了,给你个思路吧,映射 InputManager 的 injuectEvent(方法名可能不对,但是应该差不多就是这个了)方法,然后参数设定可以参照 uiautomator2.0 的源代码,只有 mousedown、mousemove、mouseup 这三种事件。
加油哦
有关操控这一块,我没有用 minitouch 哎,自己用 java 写的,调用的 framework 层的影藏接口,从 Android4.4 到现在 10 都一直能用。
我暂时只单独更新了 minicap,没有用 stf 的镜像。不过可以你自己尝试一下把跟 docker 镜像里和 minicap 相关的资源文件替换掉
需要自己写 httppost 请求 webdrviveragent 的/wda/homescreen 接口
执行 mvn tomcat7:run-war, 出现下面依赖下载不到的问题:
[WARNING] Failed to retrieve plugin descriptor for org.mortbay.jetty:iOS_remote:8.1.8.v20121106: Plugin org.mortbay.jetty:iOS_remote:8.1.8.v20121106 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.mortbay.jetty:iOS_remote:jar:8.1.8.v20121106
这种图像分类的用途,svm 是否够用?
就是把单独的图像识别相关的 python 文件放到服务器上执行啊,没有难度的。
树莓派上运行 Airtest 图像识别的速度超慢,要 2s 以上。图像识别部分我改成了服务形式的,在服务器上做,通过网络请求图像识别,一次识别可以控制在 1s 左右。
App 里打开界面卡顿,要看还是首次打开,还是 从后台拉置前台。前者就要看 onCreate 和 onResume 方法里有没有放比较耗时的操作,是否可以另起一个线程做;后者只要看 onResume 就行了。
把日志贴出来啊,你是什么设备 is not online?
收到,谢谢!
能找到链接吗?图像识别具体的工具方不方便提供
已解决,将 Appium 安装目录中的 chromedriver 版本替换为 chromedriver2.20 就可以了。
附上下载链接:https://chromedriver.storage.googleapis.com/index.html?path=2.20/
我在 switch context 时失败,Server 端 Log:
[Chromedriver] Set chromedriver binary as: /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver
[Chromedriver] Killing any old chromedrivers, running: pkill -15 -f "/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver.*--port=8000"
[Chromedriver] No old chromedrivers seemed to exist
[Chromedriver] Spawning chromedriver with: /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=8000 --adb-port=5037
[Chromedriver] [STDOUT] Starting ChromeDriver 2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f) on port 8000
Only local connections are allowed.
[JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body
[JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Mac OS X\",\"version\":\"10.12.5\"}}}"
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"args":[],"androidProcess":"com.tencent.mm:tools","extensions":[],"androidDeviceSerial":"85GACME624JX"}}}
[JSONWP Proxy] Got response with status 200: {"sessionId":"82e6879e6b9151b7eabdde4e31307544","status":33,"value":{"message":"session not created exception: please close '' and try again\n (Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.5 x86_64)"}}
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"args":[],"androidProcess":"com.tencent.mm:tools","extensions":[],"androidDeviceSerial":"85GACME624JX"}}}
[JSONWP Proxy] Got response with status 200: {"sessionId":"b185366db77d4ee0a616037f9fac3ec5","status":33,"value":{"message":"session not created exception: please close '' and try again\n (Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.5 x86_64)"}}
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"args":[],"androidProcess":"com.tencent.mm:tools","extensions":[],"androidDeviceSerial":"85GACME624JX"}}}
[JSONWP Proxy] Got response with status 200: {"sessionId":"e09b925f60e70fc87c5a41084d9fd2a5","status":33,"value":{"message":"session not created exception: please close '' and try again\n (Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.5 x86_64)"}}
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"args":[],"androidProcess":"com.tencent.mm:tools","extensions":[],"androidDeviceSerial":"85GACME624JX"}}}
[JSONWP Proxy] Got response with status 200: {"sessionId":"660d89bd2310fdd79d6bbf5421a03d36","status":33,"value":{"message":"session not created exception: please close '' and try again\n (Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.5 x86_64)"}}
[Chromedriver] Chromedriver exited unexpectedly with code null, signal SIGTERM
[Chromedriver] Changed state to 'stopped'
[Chromedriver] Error: session not created exception: please close '' and try again
(Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.5 x86_64)
at Chromedriver.callee$2$0$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-chromedriver/lib/chromedriver.js:176:15)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
Error: session not created exception: please close '' and try again
(Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.5 x86_64)
at Chromedriver.callee$2$0$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-chromedriver/lib/chromedriver.js:176:15)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[MJSONWP] Encountered internal error running command: Error: session not created exception: please close '' and try again
(Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.5 x86_64)
at Chromedriver.callee$2$0$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-chromedriver/lib/chromedriver.js:176:15)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
有哪个同学知道这个问题怎么解决?
简单使用了一下,感觉很好,重打包过程并不复杂,刚好有个做游戏的客户,请他们做了一个给我,试用了一下。重打包注入的代码的基本功能建立一个 SocketServer,实时和外部通讯,功能包括,dump 页面游戏控件,寻找 GameObject,定位 GameObject 位置等等。如果非要说对游戏本身有影响,我觉得可能在性能方面会有一点,毕竟 SocketServer 实现的功能,在网络,内存,cpu 都是要占用一些的。
优点: 1.对于测试游戏,除图像识别外,提供了另外一条路径;2. 查找游戏控件迅速,基本上毫秒间就可以获取位置;3. 重新打包过程不复杂。
缺点: 需要重打包游戏,大家都知道最终 release 的版本一般是不会有注入 Gautomator 的操作。所以只能用作功能测试,不能用作最终 release 版本测试。
@testly 请问怎么向 iOS 真机发送 home 键指令?
那这样的话,必须是有 app 的源码才能编译运行,获取性能数据啊,是吗?