AirtestProject / Airtest

UI Automation Framework for Games and Apps
http://airtest.netease.com/
Apache License 2.0
8.15k stars 1.29k forks source link

airtestIDEv1.2.1中选择poco Android后pocoservice就会频繁重启poco service is running #384

Closed yuzhujiutian closed 5 years ago

yuzhujiutian commented 5 years ago

(请尽量按照下面提示内容填写,有助于我们快速定位和解决问题,感谢配合。否则直接关闭。)

(重要!问题分类)

描述问题bug airestIDE v1.2.1,选择 Poco辅助窗口 -> Android 后,手机中pocoservice会被频繁重启(如图1所示),本问题现象,在QQ群中,也有超过3个同学陆续反馈过。

图1: pocoservice频繁重启 image (PS:检查过手机输入法,设置为yosemite为默认输入法后都无效果)

希望能尽快帮忙排查下(无法与安卓原生UI打交道,且poco频繁重启的现象出现后,会影响游戏引擎的正常UI操作),在vivo X6D(android 5.1)、华为荣耀 Che1-CL20(android4.4),都有pocoservice频繁重启的情况。

yimelia commented 5 years ago

在IDE版本1.2.0没有这个问题么?

yuzhujiutian commented 5 years ago

至少记得去年版本没有这个情况。年后也是近期集中使用一直就发现(当时在QQ群里有留言) 不知道与本地什么有冲突。从QQ群里消息来看,其他同学也确实反馈过。

image

image

WalkerMe commented 5 years ago

我也有这个问题,荣耀7手机

yuzhujiutian commented 5 years ago

单步对比了同代码、同设备,但不同PC机的airtestIDE后台日志命令,发现没有只有很少差异。

PC1电脑(台式机,操作系统win7 64位) 手机设备连接airtestIDE后,启用poco android期望获取原生UI时,手机上poco service会频繁重启,airtestIDE后台日志信息如下

initializing Android poco.
[11:57:26][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell dumpsys activity top
[11:57:27][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell dumpsys package com.netease.nie.yosemite
[11:57:27][INFO]<airtest.core.android.yosemite> local version code is 288, installed version code is 288
[11:57:27][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell settings get secure default_input_method
[11:57:27][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell ime list -a
[11:57:28][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell dumpsys package com.netease.open.pocoservice

installed version is 41, installer version is 41. force_reinstall=False
[11:57:29][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell dumpsys package com.netease.open.pocoservice.test
installed version is 0, installer version is 0. force_reinstall=False
[11:57:29][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 forward --no-rebind tcp:12897 tcp:10080
[11:57:29][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 forward --no-rebind tcp:11806 tcp:10081
[11:57:29][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell ps
[11:57:29][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell am force-stop com.netease.open.pocoservice
[11:57:29][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell am start -n com.netease.open.pocoservice/.TestActivity
[11:57:30][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell am instrument -w -e debug false -e class com.netease.open.pocoservice.InstrumentedTestAsLauncher com.netease.open.pocoservice.test/android.support.test.runner.AndroidJUnitRunner
Expecting value: line 1 column 1 (char 0)
Expecting value: line 1 column 1 (char 0)
initializing Android poco.
[11:57:54][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell dumpsys activity top
[11:57:55][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell dumpsys package com.netease.nie.yosemite
[11:57:55][INFO]<airtest.core.android.yosemite> local version code is 288, installed version code is 288
[11:57:55][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell settings get secure default_input_method
[11:57:55][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell ime list -a
[11:57:56][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell dumpsys package com.netease.open.pocoservice

installed version is 41, installer version is 41. force_reinstall=False
[11:57:56][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell dumpsys package com.netease.open.pocoservice.test
installed version is 0, installer version is 0. force_reinstall=False
[11:57:56][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 forward --no-rebind tcp:14931 tcp:10080
[11:57:56][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 forward --no-rebind tcp:13975 tcp:10081
[11:57:56][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell ps
[11:57:57][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell am force-stop com.netease.open.pocoservice
[11:57:57][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell am start -n com.netease.open.pocoservice/.TestActivity
[pocoservice.apk] stdout: b'\r\ncom.netease.open.pocoservice.InstrumentedTestAsLauncher:INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\nINSTRUMENTATION_CODE: 0\r\n'
[pocoservice.apk] stderr: b''
[11:57:57][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell am force-stop com.netease.open.pocoservice
[11:57:57][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell am instrument -w -e debug false -e class com.netease.open.pocoservice.InstrumentedTestAsLauncher com.netease.open.pocoservice.test/android.support.test.runner.AndroidJUnitRunner
Expecting value: line 1 column 1 (char 0)
Expecting value: line 1 column 1 (char 0) 

执行下面命令后 adb.exe shell am instrument -w -e debug false -e class com.netease.open.pocoservice.InstrumentedTestAsLauncher com.netease.open.pocoservice.test/android.support.test.runner.AndroidJUnitRunner 收到了返回值 Expecting value: line 1 column 1 (char 0) Expecting value: line 1 column 1 (char 0) 然后重新执行 initializing Android poco 的过程(即频繁重启 poco service)

PC2电脑(笔记本,操作系统win7 64位) 手机设备连接airtestIDE后,启用poco android期望获取原生UI时,手机上poco service不会频繁重启,可以正常获取android原生UI树,airtestIDE后台日志信息如下

initializing Android poco.
[01:01:42][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell dumpsys activity top
[01:01:43][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell dumpsys package com.netease.nie.yosemite
[01:01:43][INFO]<airtest.core.android.yosemite> local version code is 288, installed version code is 288
[01:01:43][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell settings get secure default_input_method
[01:01:43][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell ime list -a
[01:01:44][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell dumpsys package com.netease.open.pocoservice
installed version is 41, installer version is 41. force_reinstall=False
[01:01:45][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell dumpsys package com.netease.open.pocoservice.test
installed version is 0, installer version is 0. force_reinstall=False
[01:01:45][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 forward --no-rebind tcp:14944 tcp:10080
[01:01:45][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 forward --no-rebind tcp:11990 tcp:10081
[01:01:45][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell ps
[01:01:46][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell am force-stop com.netease.open.pocoservice
[01:01:46][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell am start -n com.netease.open.pocoservice/.TestActivity
[01:01:46][DEBUG]<airtest.core.android.adb> D:\winusr\netease\airtest\AirtestIDE_v1.2.1_2019-04-16_py3_win64_20190509161900\AirtestIDE_2019-05-09_py3_win64\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 04dcc6537d29 shell am instrument -w -e debug false -e class com.netease.open.pocoservice.InstrumentedTestAsLauncher com.netease.open.pocoservice.test/android.support.test.runner.AndroidJUnitRunner
still waiting for uiautomation ready.

air py文件代码如下图所示,都是airtestIDE的初始默认代码,PC2笔记本电脑可以正常获取安卓原生UI。

image

yimelia commented 5 years ago

尝试重启手机后看看是否有改善?

yuzhujiutian commented 5 years ago

与系统环境变量HTTP_PROXY, HTTPS_PROXY有关,去掉后(例如在名称后面加----), poco service 不再重启、安卓原生UI树也能正常获取。

image

yimelia commented 5 years ago

@yuzhujiutian 非常感谢,这条信息很有参考价值,我们后续会补充到帮助文档里

yuzhujiutian commented 5 years ago

临时解决方案,去掉电脑上的代理相关配置,例如系统环境变量http_proxy等 根本解决方案,希望airtest全家桶框架(airtest、poco、airtestIDE、airlab等)能支持内外网的代理的处理。

@yimelia

kevenfeng commented 5 years ago

image linux python3.5下面也出现这种情况 没有设置HTTP_PROXY 手机少的时候pocoservice卸载重装好了 手机多了 重装也没用

kevenfeng commented 5 years ago

[pocoservice.apk] stdout: b'\r\ncom.netease.open.pocoservice.InstrumentedTestAsLauncher:INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\nINSTRUMENTATION_CODE: 0\r\n' [pocoservice.apk] stderr: b'' [pocoservice.apk] stdout: b'\r\ncom.netease.open.pocoservice.InstrumentedTestAsLauncher:INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\nINSTRUMENTATION_CODE: 0\r\n' [pocoservice.apk] stderr: b'' still waiting for uiautomation ready.

yuzhujiutian commented 5 years ago

不知道你提到的手机多了多了具体是多少? 有其他群友提到,每台电脑正常情况下最多支持16个USB

@kevenfeng @saint228


Pantheon(275709420) 2019-05-27 20:15:02 大佬们 为啥我电脑只能识别44台手机 Pantheon(275709420) 2019-05-27 20:15:12 在连接都识别不了 Pantheon(275709420) 2019-05-27 20:15:18 image

落落(157366763) 2019-05-27 20:24:06 44台???你的端口号还够用吗? 无声(287313310) 2019-05-27 21:24:08 44台。。。已经超过usb的主板限定了。你是用的hub扩展吧。 无声(287313310) 2019-05-27 21:24:38 正常一台电脑只支持16个usb设备呢。