【问题标题】:"An unknown server-side error occurred while processing the command" while opening the App打开应用程序时出现“处理命令时发生未知的服务器端错误”
【发布时间】:2017-01-22 01:29:57
【问题描述】:

我使用的是 Appium 1.5.3(Ara) 版本。

我正在尝试打开本机应用程序并在模拟器上执行登录操作。当我从 Selenium 运行我的代码时,模拟器成功打开,但我的应用程序没有打开并引发错误: “处理命令时发生未知的服务器端错误。原始错误:启动应用程序时发生错误。原始错误:用于启动应用程序的活动不存在或无法启动!确保它存在并且是可启动的活动(警告: 服务器没有提供任何堆栈跟踪信息)"

我设置的所需功能:

public void Setup() throws MalformedURLException{
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "SampleDevice");
    capabilities.setCapability(AndroidMobileCapabilityType.APP_PACKAGE,"com.app-salto-new");
    capabilities.setCapability("avd", "Test");
    capabilities.setCapability(MobileCapabilityType.NO_RESET, true);
    driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
    driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
 }

Appium 日志:

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"shutdown"}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"value":"OK, shutting down","status":0}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=
[debug] [AndroidBootstrap] [UIAUTO STDOUT] Test results for WatcherResultPrinter=.
[debug] [AndroidBootstrap] [UIAUTO STDOUT] Time: 3.379
[debug] [AndroidBootstrap] [UIAUTO STDOUT] OK (1 test)
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: -1
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [UiAutomator] Shutting down UiAutomator
[debug] [UiAutomator] Moving to state 'stopping'
[debug] [UiAutomator] UiAutomator shut down normally
[debug] [UiAutomator] Moving to state 'stopped'
[debug] [ADB] Attempting to kill all uiautomator processes
[debug] [ADB] Getting all processes with uiautomator
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running /Users/srilathakondapalli/android/platform-tools/adb with args: ["-P",5037,"-s","emulator-5554","shell","ps","uiautomator"]

【问题讨论】:

    标签: appium


    【解决方案1】:

    在您想要的上限中使用应用启动活动 能力.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY,"----")

    【讨论】:

    • capabilities.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, “com.app-salto-new”);能力.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY,“nl.moboa.myclay.main.AnimationActivity”);能力.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY,“nl.moboa.myclay.debug/nl.moboa.myclay.main.AnimationActivity”);当我在 Appium 中使用 Inspector 按钮时,应用程序成功启动。 Appium 日志:[debug] [ADB] 找到包:'nl.moboa.myclay.debug' 和活动:'nl.moboa.myclay.main.AnimationActivity' ..... 在所有 3 种情况下,我收到相同的错误,如前所述。
    猜你喜欢
    • 2016-02-04
    • 1970-01-01
    • 1970-01-01
    • 2018-07-26
    • 2019-03-25
    • 1970-01-01
    • 2017-10-21
    • 2019-12-16
    • 2018-06-21
    相关资源
    最近更新 更多