Poco icon indicating copy to clipboard operation
Poco copied to clipboard

AndroidUiautomationPoco缺乏合理的并发控制,导致多实例时互相冲突,不断打印Process crashed

Open douniwan5788 opened this issue 3 years ago • 8 comments

(重要!问题分类)

  • poco库报错

描述问题bug AndroidUiautomationPoco缺乏合理的并发控制,导致多实例时互相冲突。常见现象是不断打印INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\r\nINSTRUMENTATION_CODE: 0\r\r\n并持续重启pocoservice。 不确定这个bug应该报到Airtest还是这个项目,直接原因是每次“只运行选中代码”时新建的AndroidUiautomationPoco实例并没有调用相应的stop_running,导致旧的KeepRunningInstrumentationThread不断尝试重启服务,产生冲突。但在正常运行时由于界面变化pocoservice频繁崩溃重启时也会遭遇类似的问题 #126 #137 应该都是类似的情况

poco.drivers.android.uiautomation 是我加的的log

initializing Android poco.
DEBUG   2021-03-15 15:50:57,250 [18052-26460 Dummy-32]<poco.drivers.android.uiautomation> AndroidUiautomationPoco 初始化
[15:50:57][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell dumpsys activity top ; echo ---$?---
[15:50:57][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell dumpsys package com.netease.nie.yosemite ; echo ---$?---
[15:50:57][INFO]<airtest.core.android.yosemite> local version code is 303, installed version code is 303
[15:50:57][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell settings get secure default_input_method ; echo ---$?---
[15:50:58][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell ime list -a ; echo ---$?---
[15:50:59][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell dumpsys package com.netease.open.pocoservice ; echo ---$?---
installed version is 41, installer version is 41. force_reinstall=False
[15:51:00][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell dumpsys package com.netease.open.pocoservice.test ; echo ---$?---
installed version is 0, installer version is 0. force_reinstall=False
[15:51:00][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 forward --no-rebind tcp:13439 tcp:10080
[15:51:00][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 forward --no-rebind tcp:18268 tcp:10081
[15:51:00][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell ps |echo $(grep -E com.github.uiautomator) ; echo ---$?---
DEBUG   2021-03-15 15:51:00,681 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 开始
DEBUG   2021-03-15 15:51:00,691 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:01,736 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:02,808 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:03,890 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:04,944 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:06,016 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:07,099 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:08,217 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:09,314 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:10,382 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:11,454 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:12,517 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:13,603 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:14,666 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:15,755 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:16,819 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:17,872 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:18,957 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:20,039 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:21,114 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:22,166 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:23,257 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:24,322 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:25,357 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:26,422 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:27,490 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:28,540 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:29,609 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:30,660 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:31,733 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:32,807 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:33,857 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:34,929 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:35,973 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:37,049 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:38,153 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:39,242 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:40,300 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:41,356 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:42,429 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:43,501 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:44,580 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:45,637 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:46,729 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:47,790 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:48,855 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:49,914 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:50,977 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:52,034 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:53,116 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:54,195 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:51:55,257 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
[15:51:55][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 wait-for-device
[15:51:55][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell getprop ro.build.version.sdk
F:\xxx\AirtestIDE\airtest\core\helper.py:41: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
  cls.LOGGING.warn("Device:%s updated %s -> %s" % (dev.uuid, instance, dev))
[15:51:56][WARNING]<airtest.core.api> Device:YHEQKJ8HDYRK8DU8 updated <airtest.core.android.android.Android object at 0x000002DD3C036898> -> <airtest.core.android.android.Android object at 0x000002DD3CA55080>
DEBUG   2021-03-15 15:51:56,113 [18052-2920 Dummy-52]<poco.drivers.android.uiautomation> AndroidUiautomationPoco 初始化
[15:51:56][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell dumpsys activity top ; echo ---$?---
DEBUG   2021-03-15 15:51:56,322 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
[15:51:56][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell dumpsys package com.netease.nie.yosemite ; echo ---$?---
[15:51:56][INFO]<airtest.core.android.yosemite> local version code is 303, installed version code is 303
[15:51:56][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell settings get secure default_input_method ; echo ---$?---
DEBUG   2021-03-15 15:51:57,382 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
[15:51:57][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell ime list -a ; echo ---$?---
DEBUG   2021-03-15 15:51:58,462 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
[15:51:58][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell dumpsys package com.netease.open.pocoservice ; echo ---$?---
[15:51:58][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell dumpsys package com.netease.open.pocoservice.test ; echo ---$?---
[15:51:58][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 forward --no-rebind tcp:18261 tcp:10080
[15:51:58][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 forward --no-rebind tcp:15447 tcp:10081
[15:51:59][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell ps |echo $(grep -E com.github.uiautomator) ; echo ---$?---
DEBUG   2021-03-15 15:51:59,321 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 开始
[15:51:59][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell monkey -p com.tencent.mm -c android.intent.category.LAUNCHER 1 ; echo ---$?---
DEBUG   2021-03-15 15:51:59,321 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:51:59,514 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:00,370 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:00,599 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:01,501 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:01,669 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:02,538 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:02,718 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:03,578 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:03,759 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:04,629 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:04,820 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:05,673 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:05,916 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:06,737 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:06,971 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:07,807 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:08,034 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:08,863 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:09,096 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:09,957 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:10,167 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:11,026 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:11,249 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:12,097 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:12,316 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:13,151 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:13,408 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:14,201 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:14,473 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:15,255 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:15,534 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:16,304 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:16,600 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
[15:52:17][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 wait-for-device
[15:52:17][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell getprop ro.build.version.sdk
DEBUG   2021-03-15 15:52:17,380 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:17,444 [18052-18288 Dummy-78]<poco.drivers.android.uiautomation> AndroidUiautomationPoco 初始化
[15:52:17][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell dumpsys activity top ; echo ---$?---
DEBUG   2021-03-15 15:52:17,656 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
[15:52:17][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell dumpsys package com.netease.nie.yosemite ; echo ---$?---
[15:52:17][INFO]<airtest.core.android.yosemite> local version code is 303, installed version code is 303
[15:52:17][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell settings get secure default_input_method ; echo ---$?---
DEBUG   2021-03-15 15:52:18,447 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:18,704 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
[15:52:18][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell ime list -a ; echo ---$?---
DEBUG   2021-03-15 15:52:19,496 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:19,746 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
[15:52:19][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell dumpsys package com.netease.open.pocoservice ; echo ---$?---
[15:52:20][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell dumpsys package com.netease.open.pocoservice.test ; echo ---$?---
[15:52:20][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 forward --no-rebind tcp:13537 tcp:10080
[15:52:20][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 forward --no-rebind tcp:17340 tcp:10081
[15:52:20][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell ps |echo $(grep -E com.github.uiautomator) ; echo ---$?---
DEBUG   2021-03-15 15:52:20,546 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:20,628 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 开始
[15:52:20][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell monkey -p com.tencent.mm -c android.intent.category.LAUNCHER 1 ; echo ---$?---
DEBUG   2021-03-15 15:52:20,638 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
DEBUG   2021-03-15 15:52:20,786 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:21,606 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:21,693 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
DEBUG   2021-03-15 15:52:21,838 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:22,648 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:22,739 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
DEBUG   2021-03-15 15:52:22,919 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:23,689 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:23,783 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
DEBUG   2021-03-15 15:52:23,953 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:24,729 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:24,822 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
DEBUG   2021-03-15 15:52:25,012 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:25,801 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:25,864 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
DEBUG   2021-03-15 15:52:26,068 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:26,860 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:26,924 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
DEBUG   2021-03-15 15:52:27,130 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:27,925 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:27,973 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
DEBUG   2021-03-15 15:52:28,208 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:28,983 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:29,031 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
DEBUG   2021-03-15 15:52:29,269 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
DEBUG   2021-03-15 15:52:30,089 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:30,121 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
DEBUG   2021-03-15 15:52:30,325 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 尝试重启
[pocoservice.apk] stopping PocoService
DEBUG   2021-03-15 15:52:30,636 [18052-26460 Dummy-32]<poco.drivers.android.uiautomation> AndroidUiautomationPoco 停止运行
DEBUG   2021-03-15 15:52:31,158 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:31,189 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
DEBUG   2021-03-15 15:52:31,394 [18052-26104 Thread-51]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13439 停止
[15:52:31][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell am force-stop com.netease.open.pocoservice ; echo ---$?---
DEBUG   2021-03-15 15:52:32,229 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
DEBUG   2021-03-15 15:52:32,275 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
DEBUG   2021-03-15 15:52:33,279 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
[15:52:33][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell am force-stop com.netease.open.pocoservice ; echo ---$?---
DEBUG   2021-03-15 15:52:33,342 [18052-25400 Thread-101]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:13537 尝试重启
[15:52:33][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell am force-stop com.netease.open.pocoservice ; echo ---$?---
[15:52:34][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell am start -n com.netease.open.pocoservice/.TestActivity ; echo ---$?---
[15:52:34][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell am start -n com.netease.open.pocoservice/.TestActivity ; echo ---$?---
[15:52:35][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell am instrument -w -e debug false -e class com.netease.open.pocoservice.InstrumentedTestAsLauncher com.netease.open.pocoservice.test/android.support.test.runner.AndroidJUnitRunner
[15:52:35][DEBUG]<airtest.core.android.adb> F:\xxx\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s YHEQKJ8HDYRK8DU8 shell am instrument -w -e debug false -e class com.netease.open.pocoservice.InstrumentedTestAsLauncher com.netease.open.pocoservice.test/android.support.test.runner.AndroidJUnitRunner
[pocoservice.apk] stdout: b'INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\r\nINSTRUMENTATION_CODE: 0\r\r\n'
[pocoservice.apk] stderr: b''
DEBUG   2021-03-15 15:52:38,419 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
[pocoservice.apk] stdout: b'INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\r\nINSTRUMENTATION_CODE: 0\r\r\n'
[pocoservice.apk] stderr: b''
DEBUG   2021-03-15 15:52:39,494 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
[pocoservice.apk] stdout: b'INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\r\nINSTRUMENTATION_CODE: 0\r\r\n'
[pocoservice.apk] stderr: b''
DEBUG   2021-03-15 15:52:40,599 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
[pocoservice.apk] stdout: b'INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\r\nINSTRUMENTATION_CODE: 0\r\r\n'
[pocoservice.apk] stderr: b''
DEBUG   2021-03-15 15:52:41,758 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
[pocoservice.apk] stdout: b'INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\r\nINSTRUMENTATION_CODE: 0\r\r\n'
[pocoservice.apk] stderr: b''
DEBUG   2021-03-15 15:52:42,810 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
[pocoservice.apk] stdout: b'INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\r\nINSTRUMENTATION_CODE: 0\r\r\n'
[pocoservice.apk] stderr: b''
DEBUG   2021-03-15 15:52:43,885 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
[pocoservice.apk] stdout: b'INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\r\nINSTRUMENTATION_CODE: 0\r\r\n'
[pocoservice.apk] stderr: b''
DEBUG   2021-03-15 15:52:44,974 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
[pocoservice.apk] stdout: b'INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\r\nINSTRUMENTATION_CODE: 0\r\r\n'
[pocoservice.apk] stderr: b''
DEBUG   2021-03-15 15:52:46,069 [18052-21392 Thread-75]<poco.drivers.android.uiautomation> KeepRunningInstrumentationThread port_to_ping:18261 尝试重启
[pocoservice.apk] stdout: b'INSTRUMENTATION_RESULT: shortMsg=Process crashed.\r\r\nINSTRUMENTATION_CODE: 0\r\r\n'
[pocoservice.apk] stderr: b''

复现步骤

  1. 正常连接手机
  2. 多次运行“只运行选中代码”
  3. 遭遇pocoservice崩溃,或主动在poco辅助窗选择stop

预期效果 正常处理多实例,至少“只运行选中代码”功能可以正常使用

douniwan5788 avatar Mar 15 '21 08:03 douniwan5788

请问这个问题解决了吗?

ypyu-123 avatar May 26 '21 03:05 ypyu-123

我也遇到了相同的问题,跑程序的时候还会因为pocoservice无限重启导致测试app闪退而无法进行ui操作。有没有办法能解决呢?

ypyu-123 avatar May 26 '21 03:05 ypyu-123

unittest方式,条数多了也遇到了 但是单挑都没问题

keaizhang avatar Jul 29 '21 06:07 keaizhang

+1

ivoidcat avatar Oct 14 '21 02:10 ivoidcat

same problem ( [pocoservice.apk] stdout: b'INSTRUMENTATION_STATUS: id=ActivityManagerService\r\nINSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{com.netease.open.pocoservice.test/android.support.test.runner.AndroidJUnitRunner} from pid=7658, uid=7658 not allowed because package com.netease.open.pocoservice.test does not have a signature matching the target com.netease.open.pocoservice\r\nINSTRUMENTATION_STATUS_CODE: -1\r\n' [pocoservice.apk] stderr: b'java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.netease.open.pocoservice.test/android.support.test.runner.AndroidJUnitRunner} from pid=7658, uid=7658 not allowed because package com.netease.open.pocoservice.test does not have a signature matching the target com.netease.open.pocoservice\r\n\tat android.os.Parcel.readException(Parcel.java:1684)\r\n\tat android.os.Parcel.readException(Parcel.java:1637)\r\n\tat android.app.ActivityManagerProxy.startInstrumentation(ActivityManagerNative.java:4557)\r\n\tat com.android.commands.am.Am.runInstrument(Am.java:897)\r\n\tat com.android.commands.am.Am.onRun(Am.java:406)\r\n\tat com.android.internal.os.BaseCommand.run(BaseCommand.java:51)\r\n\tat com.android.commands.am.Am.main(Am.java:124)\r\n\tat com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)\r\n\tat com.android.internal.os.RuntimeInit.main(RuntimeInit.java:301)\r\n' still waiting for uiautomation ready.

avto727 avatar Jan 26 '22 20:01 avto727

实测有效:

问题描述:如果使用了using调用了多个air/py,在多个地方进行poco初始化,AirtestIDE运行没问题,python环境运行复现该问题;

解决方法:

  1. 【简单粗暴】将所有代码全部放到一个.air中运行,不报错;
  2. 【poco流程提取】将所有poco流程单独放在main.air中,只在main中进行poco初始化,其他非poco流程可以封装在其他.air/py中;

yaoliangcui avatar Apr 10 '23 11:04 yaoliangcui

今天尝试找到了另一种解决方案,将初始化poco作为参数传入其他待引入模块,例:

  1. 在main中初始化poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
  2. 在调用引入的模块时,传递poco参数setUp(poco);
  3. 在被调用处,不进行初始化,使用接受的poco作为类/方法的参数直接使用def setUp(poco):

yaoliangcui avatar Apr 28 '23 06:04 yaoliangcui

今天尝试找到了另一种解决方案,将初始化poco作为参数传入其他待引入模块,例:

  1. 在main中初始化poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
  2. 在调用引入的模块时,传递poco参数setUp(poco);
  3. 在被调用处,不进行初始化,使用接受的poco作为类/方法的参数直接使用def setUp(poco):

方法有效,感谢!

shenglincai avatar May 22 '23 11:05 shenglincai