【发布时间】: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