【问题标题】:Unable to create a new remote session. (appium error)无法创建新的远程会话。 (appium错误)
【发布时间】:2019-07-10 16:56:22
【问题描述】:

我打算在 aws 设备场上运行我的 appium 自动化,当我这样做时

mvn clearn package
测试开始,我得到一个错误。错误:

org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话。请检查服务器日志以获取更多详细信息。原始错误:处理命令时发生未知的服务器端错误。原始错误:无法初始化检测过程。确保被测应用程序没有崩溃并调查 logcat 输出。

我在谷歌搜索了大约 2 小时 - 没有任何帮助。 我检查了 JAVA_HOME 和 ANDROID_HOME vars 是否已注册,它们是。

Java 代码:

@BeforeMethod
    public void setUp() throws MalformedURLException {
        dc.setCapability("reportDirectory", reportDirectory);
        dc.setCapability("reportFormat", reportFormat);
        dc.setCapability("testName", testName);
        dc.setCapability("platformVersion", "8.0");
        dc.setCapability("platform", "Android");
        dc.setCapability(MobileCapabilityType.DEVICE_NAME, "ce0318237d211b0f01");
        dc.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.sec.android.app.sbrowser");
        dc.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, ".SBrowserMainActivity");
        driver = new AndroidDriver<AndroidElement>(new URL("http://0.0.0.0:4723/wd/hub"), dc);
    }

Pom.xml:https://pastebin.com/s88ViRTA
Appium 服务器日志:https://pastebin.com/CU1MhdSr 谢谢谁愿意帮忙, 阿隆。

【问题讨论】:

  • 尝试设置能力 - dc.setCapability("automationName", "UiAutomator2");
  • 你能提供logcat的输出吗?错误说要看那个

标签: java appium appium-android


【解决方案1】:

请设置以下功能: "automationName": "UiAutomator1"

你应该很好。

【讨论】:

  • 这会有什么影响。我的意思是从 UiAutomator2 更改为 UiAutomator1 会降低性能或其他什么?
【解决方案2】:

尝试安装最新的appium版本

因为你的错误显示 “原始错误:无法初始化检测进程。确保被测应用程序没有崩溃并调查 logcat 输出。”

【讨论】:

    【解决方案3】:

    尝试重新安装 uiautomator2.server:

    adb uninstall io.appium.uiautomator2.server
    adb uninstall io.appium.uiautomator2.server.test
    

    这是您附加日志中的例外情况:

    ComponentInfo{io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner} from pid=17958, uid=17958 not allowed because package io.appium.uiautomator2.server.test does not have a signature matching the target io.appium.uiautomator2.server
    

    来源:https://github.com/appium/appium/issues/10993

    【讨论】:

      猜你喜欢
      • 2017-09-10
      • 2022-01-16
      • 1970-01-01
      • 2015-01-06
      • 2020-06-15
      • 2017-03-03
      • 1970-01-01
      • 2018-03-05
      相关资源
      最近更新 更多