java - Appium:UiAutomator 意外退出,代码为 0,信号为 null

标签 java appium

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 退出。非常感谢这里的任何帮助。

最佳答案

此错误似乎是在进程 com.android.commands.monkey 运行时发生的。我杀死它后,appium 正常运行测试。 要杀死它只需运行:

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

关于java - Appium:UiAutomator 意外退出,代码为 0,信号为 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43861589/

相关文章:

java - Java中不同类型变量转换的工具

java - Java 中的离散傅里叶变换(不是 FFT)

python - 如何在 pytest 中禁用 Appium 的日志调用/设置?

java - 使用 Appium 向下滚动时出现 "An unknown server-side error occurred while processing the command"

android - Appium+Selenium Android : ListView item not clicked without Thread. 休眠

java - 如何将对象列表下载为 Excel 文件?

java - 父类(super class)和子类中的构造函数

java - 在 Heroku 上部署 Java,在目标\依赖项中找不到主类

java - 无法使用java客户端7.0通过appium滚动android native 应用程序

python - 移动滚动命令在 iOS 应用程序的 appium 1.5 中不起作用