appium+python下uiautomator1换成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

报错日志:
[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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值