当前位置:   article > 正文

appium+python下uiautomator1换成uiautomator2,app启动不起来_python uiautomator2 打开app没反应

python uiautomator2 打开app没反应

在这里插入图片描述

                  appium+python下uiautomator1换成uiautomator2,app启动不起来

 一开始用的是uiautomator1,跑用例都正常的,后来想换uiautomator2的时候,app启动不起来,pycharm里报错:Original error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.
 后来百度了找到一篇博主的文章,就是要安装uiautomator2的server,我直接在本地将uiautomator2的两个apk拷出来,在本地安卓手机上安装,然后就可以正常启动app了。
 参考文章为https://blog.csdn.net/YUICUI/article/details/112468679
  • 1
  • 2
  • 3
  • 4
  • 5

报错日志:
[debug] [35m[Instrumentation][39m The process has exited with code 0[debug] [35m[WD Proxy][39m Matched ‘/status’ to command name ‘getStatus’
[debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[info] [35m[WD Proxy][39m Got response with unknown status: {“errno”:“ECONNRESET”,“code”:“ECONNRESET”,“syscall”:“read”}
[warn] [35m[UiAutomator2][39m The instrumentation process has been unexpectedly terminated. Retrying UiAutomator2 startup (#1 of 1)
[debug] [35m[UiAutomator2][39m Performing strict cleanup of automation leftovers
[debug] [35m[UiAutomator2][39m No obsolete sessions have been detected (Error: read ECONNRESET)
[debug] [35m[ADB][39m Running ‘D:\Program Files\android_sdk\platform-tools\adb.exe -P 5037 -s d31ed615 shell am force-stop io.appium.uiautomator2.server.test’[debug] [35m[ADB][39m Attempting to kill all uiautomator processes
[debug] [35m[ADB][39m Getting IDs of all ‘uiautomator’ processes
[debug] [35m[ADB][39m Running ‘D:\Program Files\android_sdk\platform-tools\adb.exe -P 5037 -s d31ed615 shell ‘pgrep ^uiautomator$ || pgrep ^uiautomator$’’[info] [35m[ADB][39m No ‘uiautomator’ process has been found[info] [35m[UiAutomator2][39m Waiting up to 30000ms for UiAutomator2 to be online…
[debug] [35m[ADB][39m Creating ADB subprocess with args: ["-P",5037,"-s",“d31ed615”,“shell”,“am”,“instrument”,"-w",“io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner”][debug] [35m[WD Proxy][39m Matched ‘/status’ to command name ‘getStatus’
[debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[info] [35m[WD Proxy][39m Got response with unknown status: {“errno”:“ECONNRESET”,“code”:“ECONNRESET”,“syscall”:“read”}[debug] [35m[Instrumentation][39m io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:[debug] [35m[WD Proxy][39m Matched ‘/status’ to command name ‘getStatus’
[debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[info] [35m[WD Proxy][39m Got response with unknown status: {“errno”:“ECONNRESET”,“code”:“ECONNRESET”,“syscall”:“read”}[debug] [35m[Instrumentation][39m Error in startServer(io.appium.uiautomator2.server.test.AppiumUiAutomator2Server):
[debug] [35m[Instrumentation][39m java.lang.NoSuchMethodError: No virtual method startMjpegServer()V in class Lio/appium/uiautomator2/server/ServerInstrumentation; or its super classes (declaration of ‘io.appium.uiautomator2.server.ServerInstrumentation’ appears in /data/app/io.appium.uiautomator2.server-1/base.apk:classes2.dex)
[debug] [35m[Instrumentation][39m at io.appium.uiautomator2.server.test.AppiumUiAutomator2Server.startServer(AppiumUiAutomator2Server.java:31)
[debug] [35m[Instrumentation][39m at java.lang.reflect.Method.invoke(Native Method)
[debug] [35m[Instrumentation][39m at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
[debug] [35m[Instrumentation][39m at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
[debug] [35m[Instrumentation][39m at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
[debug] [35m[Instrumentation][39m at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
[debug] [35m[Instrumentation][39m at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
[debug] [35m[Instrumentation][39m at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
[debug] [35m[Instrumentation][39m at androidx.test.runner.AndroidJUnit4.run(AndroidJUnit4.java:104)
[debug] [35m[Instrumentation][39m at org.junit.runners.Suite.runChild(Suite.java:128)
[debug] [35m[Instrumentation][39m at org.junit.runners.Suite.runChild(Suite.java:27)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunnerKaTeX parse error: Unexpected character: '' at position 43: …a:268) [debug] ̲[35m[Instrument…InstrumentationThread.run(Instrumentation.java:1965)[debug] [35m[Instrumentation][39m Time: 1.021
[debug] [35m[Instrumentation][39m There was 1 failure:
[debug] [35m[Instrumentation][39m 1) startServer(io.appium.uiautomator2.server.test.AppiumUiAutomator2Server)
[debug] [35m[Instrumentation][39m java.lang.NoSuchMethodError: No virtual method startMjpegServer()V in class Lio/appium/uiautomator2/server/ServerInstrumentation; or its super classes (declaration of ‘io.appium.uiautomator2.server.ServerInstrumentation’ appears in /data/app/io.appium.uiautomator2.server-1/base.apk:classes2.dex)
[debug] [35m[Instrumentation][39m at io.appium.uiautomator2.server.test.AppiumUiAutomator2Server.startServer(AppiumUiAutomator2Server.java:31)
[debug] [35m[Instrumentation][39m at java.lang.reflect.Method.invoke(Native Method)
[debug] [35m[Instrumentation][39m at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
[debug] [35m[Instrumentation][39m at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
[debug] [35m[Instrumentation][39m at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
[debug] [35m[Instrumentation][39m at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
[debug] [35m[Instrumentation][39m at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
[debug] [35m[Instrumentation][39m at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
[debug] [35m[Instrumentation][39m at androidx.test.runner.AndroidJUnit4.run(AndroidJUnit4.java:104)
[debug] [35m[Instrumentation][39m at org.junit.runners.Suite.runChild(Suite.java:128)
[debug] [35m[Instrumentation][39m at org.junit.runners.Suite.runChild(Suite.java:27)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
[debug] [35m[Instrumentation][39m at org.junit.runners.ParentRunnerKaTeX parse error: Unexpected character: '' at position 43: …a:268) [debug] ̲[35m[Instrument…InstrumentationThread.run(Instrumentation.java:1965)
[debug] [35m[Instrumentation][39m
[debug] [35m[Instrumentation][39m FAILURES!!!
[debug] [35m[Instrumentation][39m Tests run: 1, Failures: 1

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/335636
推荐阅读
相关标签
  

闽ICP备14008679号