Appium unable to start App on iPhone simulator

2019-06-12 12:02发布

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.

0条回答
登录 后发表回答