【问题标题】:Appium: UiAutomator exited unexpectedly with code 0, signal nullAppium:UiAutomator 意外退出,代码为 0,信号为空
【发布时间】:2019-06-23 13:55:38
【问题描述】:

Appium 版本:1.6.4-beta

Appium 服务器抛出以下异常:

Caused by: org.openqa.selenium.remote.SessionNotFoundException: A session is either terminated or not started (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 22 milliseconds
os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_121'
Driver info: io.appium.java_client.android.AndroidDriver

I see following in appium server log:
UiAutomator] UiAutomator exited unexpectedly with code 0, signal null
[debug] [UiAutomator] Moving to state 'stopped'
[debug] [AndroidDriver] Shutting down Android driver
[Appium] Closing session, cause was 'UiAUtomator shut down unexpectedly'
[Appium] Removing session 1865dd4e-ed7e-431a-8233-0227173400a5 from our master session list

我不明白为什么 UiAutomator 会退出。非常感谢这里的任何帮助。

【问题讨论】:

  • 你能解决这个问题吗?
  • 是的。我正在使用 2 个驱动程序实例。两者都以某种方式与同一部手机联系在一起。所以在创建一个之后,第二个实例终止了第一个。因此 UIAutomator 正在退出。

标签: java appium


【解决方案1】:

这个错误看起来就像是在进程com.android.commands.monkey 正在运行时发生的。在我杀死它后,appium 会正常运行测试。 要杀死它,只需运行:

adb shell ps | grep com.android.commands.monkey | awk '{print $2}' | xargs adb shell kill -9

【讨论】:

    【解决方案2】:

    我也看到了同样的问题 UiAutomator] UiAutomator 意外退出,代码为 0,信号为空 [调试] [UiAutomator] 进入状态“停止”

    但原因是我的设备已断开连接,当我再次连接时它工作正常。 基本上 UiAutomator 正在寻找设备和应用程序屏幕,如果它没有显示,它会在 Appium 服务器控制台中显示错误。

    【讨论】:

      猜你喜欢
      • 2019-05-24
      • 2019-06-14
      • 1970-01-01
      • 2016-08-11
      • 2013-08-17
      • 2022-11-01
      • 2022-01-15
      • 2011-10-13
      • 1970-01-01
      相关资源
      最近更新 更多