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/