airtestproject / pocoservice.apk Goto Github PK
View Code? Open in Web Editor NEWAndroid uiautomation poco-sdk implementation
Android uiautomation poco-sdk implementation
我这边用的不是python语言,所以想了解一下是否可以通过发送adb命令获得UI树的信息。
比如am instrument这种。
而且一般是卡在hrpc/object_proxy.py对象析构的时候
def __del__(self):
# 代理对象析构时,请求远程对象也析构,并不需要等待返回
if self._is_intermediate_uri__:
action = (('del', ()), )
self._client__.evaluate(RpcObjectProxy(self._uri__, self._client__, action), wait_for_response=False)
请求报文:
{"id": "", "uri": "[Lcom.netease.open.libpoco.sdk.AbstractNode;@184e8ec(61762182-3f08-4bbd-b836-49eddbe95f46)", "method": [["del", []]], "session_id": "3e6b0bdb-90a6-4dab-892c-3f3bac49f904"}
Exception ignored in: <function RpcObjectProxy.del at 0x1234687a0>
Traceback (most recent call last):
File "/Users/xs/PycharmProjects/airtest/hrpc/object_proxy.py", line 114, in del
self.client_.evaluate(RpcObjectProxy(self.uri_, self.client_, action), wait_for_response=False)
File "/Users/xs/PycharmProjects/airtest/hrpc/client.py", line 64, in evaluate
self.transport.send({'id': reqid, 'uri': obj_proxy.uri_, 'method': obj_proxy.invocation_path_})
File "/Users/xs/PycharmProjects/airtest/hrpc/transport/http.py", line 31, in send
raise TransportDisconnected(e)
hrpc.exceptions.TransportDisconnected: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))
请问这个apk是如何完成跨应用点击的呢?
我自己编译运行这个应用,发现http server根本没启动,main activity也是空的,PocoUiautomation类是在哪里完成实例化的呢?
I compile the apk use the source code in this repository.
The python code stopped at
The request failed, when I use the apk I compiled, but it works fine when use the apk in the airtest folder. Why is this?
requests.get('http://{}:{}/uiautomation/connectionState'.format(self.device_ip, port_to_ping),
def _start_instrument(self, port_to_ping, force_restart=False):
if not force_restart:
try:
state = requests.get('http://{}:{}/uiautomation/connectionState'.format(self.device_ip, port_to_ping),
timeout=10)
# the request throw exception
state = state.json()
if state.get('connected'):
# skip starting instrumentation if UiAutomation Service already connected.
return True
except:
pass
[pocoservice.apk] stdout: b'\ncom.netease.open.pocoservice.InstrumentedTestAsLauncher:INSTRUMENTATION_RESULT: shortMsg=Process crashed.\nINSTRUMENTATION_CODE: 0\n'
在哪里获取crash的日志
在本地运行该项目,替换IDE里的apk,结果是Poco辅助窗下空白没有view层级结构了,这是为什么?希望帮忙给解答一下
网易开发这个功能非常流畅,比UIautomatorviewer要快的多,请问如果想在自己的程序里获取apk中的UI树信息(非 AirtestIDE或PocoHierarchyViewer ),该如何做?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.