Appium unable to start App on iPhone simulator

喜欢而已 提交于 2019-12-23 06:05:15

问题


My goal is to run some end 2 end smoke tests against an hybrid App built with Cordova.

I am using Appium (driven by WebDriver.IO) and I can successfully spin up in an emulator the Android App and run the tests against it.

I can't though even start the iOS App on the iPhone simulator.

WebDriver.IO spits out this error:

"ERROR: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: "Command 'Scripts/bootstrap.sh -d' exited with code 1"."

And checking the logs of the iPhone simulator I see:

"Program specified by service does not contain any valid architectures for this system."

More details:

  • The app gets installed and starts but it crashes right away. I get the same with another demo app for iOS.
  • The app correctly starts when launched from XCode

What am I doing wrong?

  • Is it a certificate issue? (the App is signed with an Apple Developer Account and works when installed on real devices) -- PS. No
  • Do I need a driver for iOS? (I had to download a specific version of ChromeDriver for the Android app but I did not find further instructions regarding a driver for iOS) -- PS. No, it was already installed together with Appium: /node_modules/appium-xcuitest-driver/WebDriverAgent

UPDATE - partial success:

I managed to manually install and run the App on the device: I zipped the .app file found in ~/Library/Developer/Xcode/DerivedData/{app name}/Build/ (that is correctly built for x86_64 systems - thanks @SushiHangover) and started it on the simulator.

Pointing wdio.conf.js to the new .app.zip file now it gets correctly installed by Appium before each test run. (I can verify that the App gets correctly installed because I can tap on it and start it afterwards).

I still get the 1st error though before each test run!

vvv

LOGS with the error:

[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".


After further digging I found out how to reproduce the error:

$ cd /myTestingProject/node_modules/appium-xcuitest-driver/WebDriverAgent
$ ./Scripts/bootstrap.sh

Output:

Fetching dependencies Error: Command "bootstrap" does not exist.


Still unsolved.

来源:https://stackoverflow.com/questions/53909604/appium-unable-to-start-app-on-iphone-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!