Appium无法在iPhone模拟器上启动App

时间:2018-12-24 05:45:34

标签: ios cordova appium hybrid-mobile-app webdriver-io

我的目标是针对使用Cordova构建的混合应用程序进行一些2端烟雾测试。

我正在使用Appium(由WebDriver.IO驱动),并且可以在模拟器中成功启动Android应用并对其进行测试。

我什至无法在iPhone模拟器上启动iOS App。

WebDriver.IO吐出此错误:

  

“错误:处理命令时发生未知的服务器端错误。原始错误:由于xcodebuild失败而无法启动WebDriverAgent:“命令'Scripts / bootstrap.sh -d'以代码1退出。”

并查看我看到的iPhone模拟器的日志:

  

“服务指定的程序不包含此系统的任何有效体系结构。”

更多详细信息:

  • 该应用已安装并启动,但立即崩溃。另一个适用于iOS的演示应用程序也得到了相同的结果。
  • 从XCode启动时,应用正确启动

我在做什么错了?

  • 这是证书问题吗? (该应用程序已使用Apple开发者帐户签名,并且在实际设备上安装后可以使用)- PS。
  • 我需要 iOS驱动程序吗? (我必须为Android应用下载特定版本的ChromeDriver,但没有找到有关iOS驱动程序的进一步说明)- PS。不,它已经与Appium一起安装:{{ 1}}

更新-部分成功:

我设法在设备上手动安装并运行该应用程序: 我压缩了/node_modules/appium-xcuitest-driver/WebDriverAgent中找到的 .app 文件(该文件正确地针对x86_64系统构建-感谢@SushiHangover),并在模拟器上启动了该文件。

现在~/Library/Developer/Xcode/DerivedData/{app name}/Build/指向新的 .app.zip 文件,Appium会在每次测试运行之前正确安装该文件。 (我可以验证该应用程序是否已正确安装,因为我可以点击并随后启动它。)

尽管在每次测试运行之前我仍然遇到第一个错误!

vvv

出现错误的日志:

wdio.conf.js


进一步挖掘后,我发现了如何重现该错误:

[debug] [XCUITest] The app has been installed successfully.
[debug] [BaseDriver] Event 'appInstalled' logged at 1545635044697 (02:04:04 GMT-0500 (Eastern Standard Time))
[XCUITest] Using WDA path: '/Users/MY_USER_NAME/Documents/CODE/ACTIVE/APPIUM/asialgearoid/mine2/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/Users/MY_USER_NAME/Documents/CODE/ACTIVE/APPIUM/asialgearoid/mine2/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[debug] [XCUITest] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8100}
[debug] [XCUITest] WDA is not listening at 'http://localhost:8100/'
[debug] [XCUITest] WDA is currently not running. There is nothing to cache
[debug] [XCUITest] Trying to start WebDriverAgent 2 times with 10000ms interval
[debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1545635044905 (02:04:04 GMT-0500 (Eastern Standard Time))
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: '/Users/MY_USER_NAME/Documents/CODE/ACTIVE/APPIUM/asialgearoid/mine2/node_modules/.bin/carthage'
[debug] [XCUITest] Running WebDriverAgent bootstrap script to install dependencies
[XCUITest] [1mFetching dependencies
[XCUITest] Error: Command "bootstrap" does not exist.
...
[debug] [BaseDriver] Event 'wdaStartFailed' logged at 1545635057640 (02:04:17 GMT-0500 (Eastern Standard Time))
[debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: "Command 'Scripts/bootstrap.sh -d' exited with code 1".

输出:

  

获取依赖项   错误:命令“ bootstrap”不存在。


仍未解决。

0 个答案:

没有答案